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.5.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torchenhanced-0.3.5-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file torchenhanced-0.3.5.tar.gz.

File metadata

  • Download URL: torchenhanced-0.3.5.tar.gz
  • Upload date:
  • Size: 24.3 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.5.tar.gz
Algorithm Hash digest
SHA256 b60c52a3449a69fd5ae8a43c0748bffef32a1c27e3494b691e7fb937b83f96bc
MD5 b2f67b2a8edafc005c59fe49db8f6a8f
BLAKE2b-256 097ba89d22e6252f9593e0a24c8b9b94b99b21ecad68df68530e30ee5bd46212

See more details on using hashes here.

File details

Details for the file torchenhanced-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: torchenhanced-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for torchenhanced-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 21c86bf74915e86b93e1181bb37cdb30eaf4ac5c599b3e60343cf35f04ef1cfb
MD5 20a38f4dea1f10f7e1b9a7c9c1fbb949
BLAKE2b-256 9c440b4198bc84fb436b1f7e8ac23d4fa162137eee89e2a20fef597e398a6562

See more details on using hashes here.

Supported by

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