- The default type of float in numpy ndarray is float64, while torch.tensor would convert float64 to DoubleTensor, which would cause a series of problems.
To resolve this, use np.float32(x) to convert argument into float32 before further convert it into tensor
Pytorch 踩坑记录
最新推荐文章于 2022-04-14 09:33:26 发布