Wrappers for pytorch stuff I use on the daily
Project description
TorchEnhanced
Wrappers for pytorch stuff I use on the daily. Basically a minimal 'pytorch lightning', I was just not aware it existed at the time of creation.
Basic Usage
Install with pip install torchenhanced
.
Here we describe how to use at a basic level the different components included in torchenhanced
. There are many unrelated things it helps to do, so we dedicate a section to each.
Improved nn.Module
torchenhanced
defines two new classes which are meant as stand-in for nn.Module
.
DevModule
Import with from torchenhanced import DevModule
.
DevModule
is short for 'DeviceModule'. It is a nn.Module
, but has an additional attribute device
, which helps keeps track of the current device it is on.
Use it just like nn.Module
, except it needs to be initialized with a device :
class MyModule(DevModule):
def __init__(hidden, device='cpu'):
super().__init__(device)
layer = nn.Linear(hidden,hidden,device=self.device)
Works just [STILL WIP]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file torchenhanced-0.3.2b4.tar.gz
.
File metadata
- Download URL: torchenhanced-0.3.2b4.tar.gz
- Upload date:
- Size: 24.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b1e25cd3dc30808fb7ed3e35fdee8c1353521fea36fc41802cf85215878c71a |
|
MD5 | 82811a41a57673b79cb6e471517f7553 |
|
BLAKE2b-256 | 17e684a94896c51df49b91e16b12ea075c4a8b28fb938d855a29ef6cbaafc278 |
File details
Details for the file torchenhanced-0.3.2b4-py3-none-any.whl
.
File metadata
- Download URL: torchenhanced-0.3.2b4-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6358daae660cfcfca4b2a76810ebd68848a7a4cc99fc7f492bbbb98359549314 |
|
MD5 | df978ebaf556dacf453203defb76877a |
|
BLAKE2b-256 | a9d376a9f35772a5e87b1d7d38c5ff69dee7b394f3576bc55df0e96cf5d585cd |