Expected tensor for argument #1 'indices' to have scalar type Long; but got CUDAFloatTensor instead 运行代码时出现此问题,参数类型的错误 传的参数应该是torch.longtensor类型 使用a=torch.LongTensor()定义即可