import torch
gpu_use= torch.cuda.is_available()
print(gpu_use)
# Decide which device we want to run on
device = torch.device("cuda:0" if (torch.cuda.is_available()) else "cpu")
print(device)
print(torch.cuda.get_device_name(0))
pytorch查看gpu信息,gpu是否可用
最新推荐文章于 2024-07-06 14:11:57 发布