查看Pytorch是否安装成功解决办法

import torch    # 如正常则静默
a = torch.Tensor([1.])    # 如正常则静默
a.cuda()    # 如正常则返回"tensor([ 1.], device='cuda:0')"
from torch.backends import cudnn # 如正常则静默
cudnn.is_acceptable(a.cuda())    # 如正常则返回 "True"

 

posted @ 2020-04-10 17:21  DuanYongchun  阅读(13572)  评论(0编辑  收藏  举报