Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torchenhanced-0.3.2b2.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

torchenhanced-0.3.2b2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file torchenhanced-0.3.2b2.tar.gz.

File metadata

  • Download URL: torchenhanced-0.3.2b2.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for torchenhanced-0.3.2b2.tar.gz
Algorithm Hash digest
SHA256 7efc1c8b13da08f4ad6339199176bdb90f1de96eda4ec78136931b20b2938a15
MD5 527f42276ff91f3daee2c4644c592ebf
BLAKE2b-256 5265da48e1389ca4d0e0363af3a561220543f600452557c0def723ee78d58759

See more details on using hashes here.

File details

Details for the file torchenhanced-0.3.2b2-py3-none-any.whl.

File metadata

File hashes

Hashes for torchenhanced-0.3.2b2-py3-none-any.whl
Algorithm Hash digest
SHA256 84e8119cd3c62cc0dd67a553fd7729b976c4be137a422b0998ed74befa4d9d86
MD5 97ef77a7634f743d35e08157f57bdf9b
BLAKE2b-256 13148b22a0fcf5a328636f92baa92bd4d23b3213bc36cbabdcd4d636903e86b0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page