1import torch
2
3torch.cuda.is_available()
4>>> True
5
6torch.cuda.current_device()
7>>> 0
8
9torch.cuda.device(0)
10>>> <torch.cuda.device at 0x7efce0b03be0>
11
12torch.cuda.device_count()
13>>> 1
14
15torch.cuda.get_device_name(0)
16>>> 'GeForce GTX 950M'
17