PyTorch for CPU with pip-compile

Hello, I’m using pip-compile (from pip-tools) for managing versions of python packages. I put them in and this command generates requirements.txt for me.

I want to use the CPU version of PyTorch. This could be done with torch==1.10.0+cpu. However, the CPU specification is provided in the version string, not in the name of the package. This also means that I’m requesting a specific release version (1.10.0).

How can I specify in that I want to use the newest version of PyTorch, but specifically the one for CPU?

I’ve tried the following



but it didn’t work.

So far I found a proper name for the +cpu part. It’s called a local version label.