autodevice
Automatically assign devices in-line with pytorch code
Usage
from autodevice import AutoDevice
x = torch.randn([200, 50]).to(AutoDevice())
CUDA/GPU:
tensor([[ 2.6905, -0.3037, -0.3607],
[ 0.2258, -0.1755, 0.6599],
[ 1.3046, -0.9389, 0.7358]], device='cuda:0')
CPU:
tensor([[ 2.6905, -0.3037, -0.3607],
[ 0.2258, -0.1755, 0.6599],
[ 1.3046, -0.9389, 0.7358]])
On Apple Silicon (M1, M2):
tensor([[ 0.5382, 1.1173, 1.1175],
[-0.0125, -0.2406, 0.2343],
[-0.6067, -0.7728, 0.1697]], device='mps:0')
Installation
pip install autodevice
Metadata
Release files for autodevice 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autodevice-0.1.0.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autodevice-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.5 kB
Release files / autodevice-0.1.0.tar.gz
| Download URL | autodevice-0.1.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
458731ab79d7cccdd041f40f7c387a424ba83669febc8ef8f292a9d219601b2a
|
|
BLAKE2b-256 checksum How to use checksums |
f15693ed616b21cea29d52b0c8e3bb47dde210cece99a1d6738974080882e00d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|
Release files / autodevice-0.1.0-py3-none-any.whl
| Download URL | autodevice-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5c5f57c45b40cd4af62978abd3f5beef5b2f088f506f5c729c3bce5d70052eca
|
|
BLAKE2b-256 checksum How to use checksums |
cd79fc07ca3758b683e42417a47be229b72110d10f5e0e7985458e02c1d88fc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|