So I am trying to create the following rather simple function:
# Make sure to use pytorch version 1.6.0 as I am using type torch.cfloat from torch import cos, tensor def func(): return tensor([[1.0, - 1j*cos(tensor(1.0))],[1.0,0.0]], dtype=torch.cfloat) print(func())
I get an error stating that: “RuntimeError: value cannot be converted to type double without overflow: (0,-0.848705)”.
I have played around with different options for a while and it seems like this error is induced by the fact that I am doing 1j*cos(tensor(1.0)). Can someone explain what is going wrong when I multiply this cosine of tensor(1.0) by this complex amplitude?