Torch Tensor from `numpy` complex not working

How much of the complex API is actually supported on Torch?

1.4.0 Documentation

>>> torch.real(torch.tensor([-1 + 1j, -2 + 2j, 3 - 3j]))
tensor([ -1,  -2,  3])

Running on Colab, Torch version: 1.4.0

RuntimeError                              Traceback (most recent call last)
<ipython-input-65-6ab8515aa959> in <module>()
----> 1 torch.real(torch.tensor([-1 + 1j, -2 + 2j, 3 - 3j]))

RuntimeError: Could not infer dtype of complex

Hey @eduardo4jesus this should work on the latest master build. I fixed it last week: https://github.com/pytorch/pytorch/pull/33361

1 Like

Oh I see. I actually though about it, but then I checked that the documentation version was right. So, I got confused.

Any chance of having built in complex multiplication coming soon?

Thanks a lot.

yeah we are working on adding the matrix multiplication. should be out soon

1 Like