Skip to content

Implement torch.flip for complex numbers #37698

@anjali411

Description

@anjali411
>>> x = 1j * torch.arange(8).view(2, 2, 2)
>>> torch.flip(x, [0, 1])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: "flip_cpu" not implemented for 'ComplexFloat'

This task would most likely just involve extending the dispatch to complex numbers.

Once torch.flip is added for complex, torch.rot90 would also start working for complex. so, please add test for rot90 as well.

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