日萌社
人工智能AI:Keras PyTorch MXNet TensorFlow PaddlePaddle 深度学习实战(不定时更新)
RuntimeError: expected device cpu and dtype Float but got device cpu and dtype Long
把 position = torch.arange(0, max_len).unsqueeze(1)
修改为 position = torch.arange(0., max_len).unsqueeze(1)
就是int值的0修改为Float值的0.