Skip to content

Poor support of torch.pow(out) for complex tensor #43829

@zasdfgbnm

Description

@zasdfgbnm
>>> import torch
>>> r = 2. 
>>> c = 2. + 2j
>>> rt = torch.randn(5, dtype=torch.float32)
>>> ct = torch.randn(5, dtype=torch.complex64)
>>> o = torch.randn(5, dtype=torch.complex64)
>>> 
>>> torch.pow(c, rt, out=o)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: value cannot be converted to type double without overflow: (2,2)
>>> torch.pow(c, ct, out=o)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: value cannot be converted to type double without overflow: (2,2)
>>> torch.pow(rt, r, out=o)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Found dtype ComplexFloat but expected Float

cc @ezyang @anjali411 @dylanbespalko

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: complexRelated to complex number support in PyTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions