DEV Community

Florian Polster
Florian Polster

Posted on

How to install only the CPU version of pytorch in pdm

I've been chasing how to do this for days and Google couldn't help me. So here's me hoping I'm helping the next poor soul.

In pyproject.toml:

dependencies = [ "torch>=2.7.1", ] [[tool.pdm.source]] type = "index" url = "https://download.pytorch.org/whl/cpu/" name = "torch" 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)