Expected all tensors to be on the same device, but found at least two device, cuda: 0 and cpu!
重点关注问题的定位信息
自定义的x未放入cuda中训练,需放入cuda中加载
self.x = self.x.to(device=torch.device('cuda' if torch.cuda.is_available() else 'cpu'))
Expected all tensors to be on the same device, but found at least two device, cuda: 0 and cpu!
重点关注问题的定位信息
自定义的x未放入cuda中训练,需放入cuda中加载
self.x = self.x.to(device=torch.device('cuda' if torch.cuda.is_available() else 'cpu'))