File size: 173 Bytes
376ab70
 
 
 
 
 
1
2
3
4
5
6
7
import torch

print("available", torch.cuda.is_available())
tensor = torch.zeros(1, device="cuda")
print("allocated", tensor)
print("device", torch.cuda.get_device_name(0))