【pytorch】torch 查看GPU

import torch

查看cuda是否可用

print(torch.cuda.is_available())

查看cuda设备的数量

print(torch.cuda.device_count())

查看当前使用的cuda编号

print(torch.cuda.current_device())

查看GPU设备名字

print(torch.cuda.get_device_name())

查看设备容量

print(torch.cuda.get_device_capability(0))
return:
True
1
0
GeForce GTX 1060
(6, 1)
posted @ 2022-05-02 19:41  jucw  阅读(495)  评论(0编辑  收藏  举报