Tensors of the same index must be on the same device and the same dtype except `step` tensors that can be CPU and float32 notwithstanding
避免使用 torch.set_default_dtype(torch.float64)
可以尝试采用
model. Double
或者
model.to(torch. Double)
m = torch().to(device).to(torch.float64)
参考: