xxxxxxxxxx
import torch
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
xxxxxxxxxx
torch.cuda.is_available()
torch.cuda.current_device()
torch.cuda.device(0)
torch.cuda.device_count()
torch.cuda.get_device_name(0)
Check if Cuda is enabled on PyTorch
xxxxxxxxxx
import torch
torch.cuda.is_available()