Sorry, no idea what might be going on.
Could you restart the kernel or are you running in a clean environment?
I would recommend to create a new virtual environment, reinstall PyTorch and rerun the script.