RuntimeError('dot : expected both vectors to have same dtype, but found Double and Float

Viewed 624

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)

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>)

Any suggestions please? Thanks!

1 Answers

cast nuNormalized to float from double.

also you might consider moving both to the same device.

Related