device-selector
A small Python library to automatically pick the best available PyTorch device.
-
select_best_device()
Automatically returns one of:"cuda"if an NVIDIA GPU is available via CUDA"mps"if you're on Apple Silicon with Metal Performance Shaders available"cpu"otherwise
-
check_or_select_device(requested_device: Optional[str])- If
requested_deviceisNone, it behaves likeselect_best_device(). - Otherwise, checks if the requested device is actually available and raises an error if not.
- If
Installation
pip install https://github.com/darizae/device-selector/releases/download/v0.1.0/device_selector-0.1.0-py3-none-any.whl
Metadata
Release files for device-selector 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 | Provenance | Actions |
|---|---|---|---|---|
| device_selector-0.1.0.tar.gz | 3.4 kB | Without provenance | Details for device_selector-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| device_selector-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for device_selector-0.1.0-py3-none-any.whl |
Total release size: 7.4 kB
Release files / device_selector-0.1.0.tar.gz
| Download URL | device_selector-0.1.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a6b52c68bb28cf271e0dbc3b7ee797519a08eaf6167b5f87d2c46b13e38bed6
|
|
BLAKE2b-256 checksum How to use checksums |
6026aa3353b602ec1ca07c8516e1a842948bb8bcf31f9e61063caae126a08694
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Release files / device_selector-0.1.0-py3-none-any.whl
| Download URL | device_selector-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a9138bd62ee3cc76c67f55e56c4e3aa95191a30c2173fedb4280ee4ec2bfe99b
|
|
BLAKE2b-256 checksum How to use checksums |
4696bfd7039113fdf1d361817bca3e9bc4fdeaa89225bab6afffcff4ba29153d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Security for device-selector 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.