错误:将一个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))即可。
版权声明:本文为Anonymity_原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。