Does PyTorch support complex data-type?

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

ra_schoonhoven: <p>I am definitely not an expert but it seems people are working on it:</p>
<aside class="onebox githubissue">
  <header class="source">
      <a href="https://github.com/pytorch/pytorch/issues/755" target="_blank" rel="nofollow noopener">github.com/pytorch/pytorch</a>
  </header>
  <article class="onebox-body">
    <div class="github-row">
  <div class="github-icon-container" title="Issue">
	  <svg width="60" height="60" class="github-icon" viewbox="0 0 14 16" aria-hidden="true"><path d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg>
  </div>

  <div class="github-info-container">
    <h4>
      <a href="https://github.com/pytorch/pytorch/issues/755" target="_blank" rel="nofollow noopener">Integrating complex tensors</a>
    </h4>

    <div class="github-info">
      <div class="date">
        opened <span class="discourse-local-date" data-format="ll" data-date="2017-02-15" data-time="23:06:57" data-timezone="UTC">11:06PM - 15 Feb 17 UTC</span>
      </div>


      <div class="user">
        <a href="https://github.com/PhilippPelz" target="_blank" rel="nofollow noopener">
          <img alt="PhilippPelz" src="https://avatars1.githubusercontent.com/u/1299153?v=4" class="onebox-avatar-inline" width="20" height="20">
          PhilippPelz
        </a>
      </div>
    </div>
  </div>
</div>

<div class="github-row">
  <p class="github-content">New description from @ezyang:
Work is in progress at https://github.com/Roger-luo/pytorch-complex
Organizational principles
Complex tensor support is important to PyTorch, and we will accept patches...</p>
</div>

<div class="labels">
    <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">feature</span>
    <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">module: complex</span>
    <span style="display:inline-block;margin-top:2px;background-color: #B8B8B8;padding: 2px;border-radius: 4px;color: #fff;margin-left: 3px;">triaged</span>
</div>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>


Poornima_Jain: <p>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.</p>

ra_schoonhoven: <p>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.</p>

Poornima_Jain: <p>Okay, I didn’t notice the recent updates. It means the feature is in pipeline at least. Thanks!</p>

albanD: <p>Hi,</p>
<p>Yes, this is work in progress for this half <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=9" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p>

atithi8: <p>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?</p>

albanD: <p>Hi,</p>
<p>This is still work in progress.<br>
For gradients, there are still ongoing discussion on which convention we want to use: <a href="https://github.com/pytorch/pytorch/issues/41857">https://github.com/pytorch/pytorch/issues/41857</a></p>

Poornima_Jain: <p>Hi <a class="mention" href="/u/alband">@albanD</a>, thanks for the reference.<br>
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.<br>
Could you please advise me with this?</p>

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