pytorch使用gpu的方法

device=torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model=model.to(device)
x=x.to(device)
y=y.to(device)

猜你喜欢

转载自blog.csdn.net/yzy__zju/article/details/85014576