text_plain_output_1.png
import torch

if torch.cuda.is_available():
    device = torch.device('cuda')
    print(f'Using {torch.cuda.device_count()} GPU(s)!')
    print(f'Device name: {torch.cuda.get_device_name(0)}')
else:
    device = torch.device('cpu')
    print('No GPU available.')