Skip to content

Add moveaxis function #36048

@carlosgmartin

Description

@carlosgmartin

🚀 Feature

Add a function that behaves like numpy's moveaxis.

Motivation

In my experience, it is extremely clumsy and bug-prone to use permute or a sequence of transposes to move an axis from a source to a destination, especially when working with a variable-dimension tensor.

Pitch

Implement a function torch.moveaxis that moves axes to new positions while keeping the other axes in their original order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: numpyRelated to numpy support, and also numpy compatibility of our operatorstriagedThis 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