Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add
torch.movedim
#41480Add
torch.movedim
#41480Changes from 11 commits
47b53e2
2ec66e9
b15a905
e73f592
2206c0e
2e58ae6
b02c386
6eccc99
75d46c6
2cc8692
88b7209
92f1ac9
f3c0976
5703583
66960dc
345104c
b54bb51
2b3d6bb
978f9d4
22e8f5a
ce3923d
c5e5da5
1f6f7cb
e77d322
0b6d29d
e88f99d
9fe2399
4b48232
184696e
f4cf3c1
cc19379
7fbd2fc
9bcd29c
3ad19aa
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
An internal linter pointed these out.
source_iter
anddestination_iter
are never actually used, can we remove them and just do:?
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.
Actually, I thought about it a little more. It would be nice to use
source_iter
anddestination_iter
to assert thatsource_dims
anddestination_dims
have the correct number of elements. So something likeBut either way, we should either use
source_iter / destination_iter
or delete themThere 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.
Makes sense.
Will use them as suggested in second comment.
Thanks!
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.
Thanks!
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.
No method variant?
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.
Since
numpy.moveaxis
is function only.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.
It's OK not to have a method variant to start, but just because NumPy doesn't have one doesn't mean we shouldn't, either. The closet analogue to this function is probably permute, which is a method.
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.
This needs to be clearer about which dimensions are moving where. Also: what does it mean for a dimension to "move?"