📜  测试 cuda pytorch - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:29.796000             🧑  作者: Mango

代码示例1
import torch

torch.cuda.is_available()
>>> True

torch.cuda.current_device()
>>> 0

torch.cuda.device(0)
>>> 

torch.cuda.device_count()
>>> 1

torch.cuda.get_device_name(0)
>>> 'GeForce GTX 950M'