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

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

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

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

posted @ 2018-11-10 15:15  勿忘初心233  阅读(11549)  评论(0编辑  收藏  举报