【pytorch】torch 查看GPU
生活随笔
收集整理的這篇文章主要介紹了
【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)總結
以上是生活随笔為你收集整理的【pytorch】torch 查看GPU的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Anaconda】conda :未找到
- 下一篇: 【计网】计算机网络期末总复习-谢希仁(个