pytorch验证GPU版本是否可用

import torch
 
torch.cuda.is_available()
True
 
torch.cuda.current_device()
0
 
torch.cuda.device(0)
<torch.cuda.device object at 0x0000023034332438>
 
torch.cuda.device_count()
1
 
torch.cuda.get_device_name(0)
'GeForce GTX 1660'
————————————————

  

版权声明:本文为CSDN博主「Mr.Jcak」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_38314865/article/details/102410371

posted @ 2021-05-15 13:47  月夜_1  阅读(2355)  评论(0编辑  收藏  举报