net = net.to(device=torch.device(f'cuda:{0}'))
for X,y in train_iter:
X = X.to(torch.device(f'cuda:{0}'))
y = y.to(torch.device(f'cuda:{0}'))
pytorch将数据送到GPU进行训练
最新推荐文章于 2023-11-07 16:02:11 发布
net = net.to(device=torch.device(f'cuda:{0}'))
for X,y in train_iter:
X = X.to(torch.device(f'cuda:{0}'))
y = y.to(torch.device(f'cuda:{0}'))