解决RNN中的RuntimeError: expected scalar type Long but found Float报错
项目场景:今天看了个RNN实例的代码,想用自己的数据试试传入RNN,奈何报错。问题描述:报错是这样的RuntimeError:expectedscalartypeLongbutfoundFloat原因分析:我报错的输入是这样的:input=torch.tensor([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,