[英]RuntimeError('dot : expected both vectors to have same dtype, but found Double and Float
I am trying to perform this operation:我正在尝试执行此操作:
L_c += 1 - torch.abs(torch.dot(nuNormalized, Nu))
where:在哪里:
nuNormalized -> tensor([ 0.3790, -0.4208, 0.8242], dtype=torch.float64)
numNormalized -> tensor([ 0.3790, -0.4208, 0.8242], dtype=torch.float64)
Nu -> tensor([-0.9961, -0.9961, -0.9961], device='cuda:0')
Nu -> tensor([-0.9961, -0.9961, -0.9961], device='cuda:0')
I am getting this error:我收到此错误:
(<class 'RuntimeError'>, RuntimeError('dot: expected both vectors to have same dtype, but found Double and Float',), <traceback object at 0x7f4d276155c8>)
(<class 'RuntimeError'>, RuntimeError('dot: 期望两个向量具有相同的 dtype,但发现 Double 和 Float',), <traceback object at 0x7f4d276155c8>)
Any suggestions please?请问有什么建议吗? Thanks!
谢谢!
cast nuNormalized to float from double.将 nuNormalized 转换为从 double 浮动。
also you might consider moving both to the same device.您也可以考虑将两者移至同一设备。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.