错误:将一个np.int64的数传给embedding
报错内容
RuntimeError: Expected tensor for argument #1 ‘indices’ to have scalar type Long; but got CPUType instead (while checking arguments for embedding)
解决:对这个数进行数值转换,转为python内置int类型即可,np.asscalar(np.int16(a))即可。
错误:将一个np.int64的数传给embedding
报错内容
RuntimeError: Expected tensor for argument #1 ‘indices’ to have scalar type Long; but got CPUType instead (while checking arguments for embedding)
解决:对这个数进行数值转换,转为python内置int类型即可,np.asscalar(np.int16(a))即可。