windows安装pytorch
通过pip来安装pytorch.

1、更新pip
在激活的虚拟环境中,输入命令:
python -m pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/
2、安装cpu版的pytorch
pip3 install torch torchvision torchaudio -i https://mirrors.aliyun.com/pypi/simple/
3、安装cuda
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 -i https://mirrors.aliyun.com/pypi/simple/
替换cu118
为你的CUDA版本(如果适用)。