Does PyTorch support complex data-type?

Does PyTorch support complex valued variables/tensors yet?
If not, why is it not included in PyTorch?
Thanks for any comments on this.

I am definitely not an expert but it seems people are working on it:

Yeah, I saw this post but it seems to be a bit old (2017). Complex data-type being a basic and simple feature, I was wondering why it is not being added with priority.

Yes that is true but the latest updates are from a few days ago so it seems active. As to why it takes a lot of time or how its prioritized I don’t know.

Okay, I didn’t notice the recent updates. It means the feature is in pipeline at least. Thanks!

Hi,

Yes, this is work in progress for this half :slight_smile:

1 Like

What is the update on this project. Is torch_complex ready to be used? If yes, will it be compatible with Autograd for Complex Numbers?

Hi,

This is still work in progress.
For gradients, there are still ongoing discussion on which convention we want to use: https://github.com/pytorch/pytorch/issues/41857

1 Like

Hi @albanD, thanks for the reference.
Could you please through some light on how soon complex backpropagation could be integrated into Pytorch. Actually I am working on implementing complex backpropagation using Wirtinger derivatives for my thesis work by overriding backward functions, using Pytorch hooks to modify gradients etc. As I am working single-handedly on this and the framework itself is just a prerequisite for the further experimentation on complex-valued data, I was thinking if Pytorch is going to integrate this framework in the near future, it would not be worth my single-handed efforts and time to create it from scratch.
Could you please advise me with this?

Hi @Poornima_Jain thanks for reaching out! We are in the process of updating autograd formulas to work properly for complex (example PR: https://github.com/pytorch/pytorch/pull/43208) We are hoping to have complex autograd in beta in 1.8 release. You can check https://github.com/pytorch/pytorch/issues/33152 to see what’s being worked on for complex and add comments if you specifically need backward support for certain operators. Thank you!