Expected tensor for argument #1 'indices' to have scalar type Long; but got CUDAFloatTensor instead

运行代码时出现此问题,参数类型的错误

传的参数应该是torch.longtensor类型

使用a=torch.LongTensor()定义即可

原文地址:https://www.cnblogs.com/yangruicvpr/p/9939497.html