以下代码print(torch.version)print(torch.cuda.is_available())print(torch.zeros(1).cuda())cmd 中可以运行成功。但是在pycharm中不能运行。
收起
你的x,y后面有没有加cuda()呢?
报告相同问题?