There is a known issue with PyTorch 2.5.
You can read more about it here:
https://github.com/pytorch/pytorch/issues/142344
One solution is to download the source code, modify the two files as described by malfet, and then compile the source code. This issue is expected to be resolved in PyTorch 2.6.
However, the simplest solution I found was to install the nightly versions of PyTorch:
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
Best regards,
--KC