Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trace_backward does not work for complex tensors #50381

Closed
anjali411 opened this issue Jan 11, 2021 · 0 comments
Closed

trace_backward does not work for complex tensors #50381

anjali411 opened this issue Jan 11, 2021 · 0 comments
Labels
complex_autograd module: complex Related to complex number support in PyTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@anjali411
Copy link
Contributor

anjali411 commented Jan 11, 2021

I ran the code below after locally rebasing on #50380 and adding trace to GRADIENT_IMPLEMENTED_FOR_COMPLEX in gen_variable_type.py.

>>> x=torch.randn(3, 3, dtype=torch.cfloat, requires_grad=True)
>>> y=x.trace()
>>> y.backward()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/chourdiaanjali/pytorch2/torch/tensor.py", line 225, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
  File "/home/chourdiaanjali/pytorch2/torch/autograd/__init__.py", line 147, in backward
    allow_unreachable=True, accumulate_grad=True)  # allow_unreachable flag
RuntimeError: _th_index_fill_ not supported on CPUType for ComplexFloat

cc @ezyang @anjali411 @dylanbespalko @mruberry

@anjali411 anjali411 added module: complex Related to complex number support in PyTorch complex_autograd labels Jan 11, 2021
@zhangguanheng66 zhangguanheng66 added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complex_autograd module: complex Related to complex number support in PyTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants