问题描述: 问题涉及到了使用torch进行处理tensor时,数据类型不匹配,需要转化成float格式。 解决方法: 讲该变量的数值类型进行转换即可。 x=torch.tensor(x,dtype=torch.float)