检查cuda和显卡的可用性 import torch device_gpu = torch.device('cuda' if torch.cuda.is_available() else 'cpu') print(device_gpu) print(torch.cuda.is_available())