-
Notifications
You must be signed in to change notification settings - Fork 27.7k
Add moveaxis function #36048
Copy link
Copy link
Closed
Labels
module: numpyRelated to numpy support, and also numpy compatibility of our operatorsRelated 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 moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Metadata
Metadata
Assignees
Labels
module: numpyRelated to numpy support, and also numpy compatibility of our operatorsRelated 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 moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
🚀 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.moveaxisthat moves axes to new positions while keeping the other axes in their original order.