print(torch.cuda.is_available())
if torch.cuda.is_available():
device = torch.device(‘cuda’)
y = torch.ones_like(x,device=device)
x = x.to(device)
12-23
06-28
3万+
01-06
10万+
print(torch.cuda.is_available())
if torch.cuda.is_available():
device = torch.device(‘cuda’)
y = torch.ones_like(x,device=device)
x = x.to(device)