Skip to main content

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_device is None, it behaves like select_best_device().
    • Otherwise, checks if the requested device is actually available and raises an error if not.

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)

Source distribution for device-selector 0.1.0
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)

Table of built distributions (wheels) for device-selector 0.1.0
File Interpreter ABI Platform Actions
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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page