带cuda功能的pytorch可以利用GPU 加速计算。目前最新的pytorch (注:库的名称是torch)版本是19.0,最新的cuda版本是11.1。...下载链接如下:
https://download.pytorch.org/whl/cu111/torch_stable.html
可以根据自己的python版本下载对应的文件。...:
pip3 install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio===0.9.0 -f https://download.pytorch.org.../whl/torch_stable.html
若已经安装好了,会显示如下信息:
import torch
a = torch.rand(100,100)
print(a)
b = a.cuda()...0.6445, 0.9279, 0.7003],
[0.7662, 0.7129, 0.2193, ..., 0.6080, 0.6775, 0.1158]],
device='cuda