https://www.cnblogs.com/QingHuan/p/10016959.html
net = Net() if torch.cuda.is_available(): print("Using GPU") device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") net.to(device)
https://www.cnblogs.com/QingHuan/p/10016959.html
net = Net() if torch.cuda.is_available(): print("Using GPU") device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") net.to(device)