-
Notifications
You must be signed in to change notification settings - Fork 49
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
Rename (and move) transpose
to permute_dims
#247
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is a new function, right (not in any of the existing APIs under this name)? Is there any reason to keep the default argument for axes? |
@asmeurer It is a new function insofar as it has a different name, but still retains the same default behavior as |
I would propose making axes a required argument. I don't feel strongly about it, but reversing seems like an odd default. Unless there are legitimate use-cases for reversing (I was never clear that there were). |
…rename-transpose
transpose
to permute
transpose
to permute_dims
… update reference
…rename-transpose
Updated the PR such that the function name is |
This PR:
transpose
API topermute_dims
(which is consistent with the*_dims
naming convention (e.g.,expand_dims
)), as discussed in gh-228.axes
argument a required argument (as discussed in the consortium meeting held 2021-09-16).Background
The current behavior of
transpose
where all axes are reversed, even for arrays having more than two dimensions, is considered problematic due to its conflicting with the mathematical definition and not operating on batches of matrices.By renaming the
transpose
function topermute_dims
and moving the API to the set of manipulation functions, we both (1) provide a functional API which allows consumers to achieve equivalent functionality possible today (see gh-245), thus providing a migration path, and (2) avoid conflicting definitions.This PR further helps pave the way for a dedicated
matrix_transpose
API for operating on stacks of matrices.