gpu命令cuda命令

# device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
os.environ["CUDA_VISIBLE_DEVICES"]="0,1"
# test=torch.cuda.is_available()
print(torch.cuda.device_count())
print(torch.cuda.get_device_name(1))
print(torch.cuda.current_device())
torch.cuda.set_device(0)


posted @ 2019-09-05 16:54  交流_QQ_2240410488  阅读(1469)  评论(0编辑  收藏  举报