New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

device-selector

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

device-selector

A utility library to select and handle devices (CPU/GPU) seamlessly.

  • 0.1.0
  • PyPI
  • Socket score

Maintainers
1

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc