8000 Reversing along a dimension, similarly to numpy · Issue #95160 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

Reversing along a dimension, similarly to numpy #95160

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

Open
dennisushi opened this issue Feb 20, 2023 · 2 comments
Open

Reversing along a dimension, similarly to numpy #95160

dennisushi opened this issue Feb 20, 2023 · 2 comments
Labels
feature A request for a proper, new feature. module: advanced indexing Related to x[i] = y, index functions module: numpy Related to numpy support, and also numpy compatibility of our operators triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@dennisushi
Copy link
dennisushi commented Feb 20, 2023

🚀 The feature, motivation and pitch

In numpy you can reverse an array as arr[::-1] along any dimension. The same in torch raises an error: ValueError: step must be greater than zero. It would be useful if both operated the same way.

Alternatives

No response

Additional context

No response

cc @mruberry @rgommers

@janeyx99 janeyx99 added feature A request for a proper, new feature. triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module module: numpy Related to numpy support, and also numpy compatibility of our operators module: advanced indexing Related to x[i] = y, index functions labels Feb 22, 2023
@dennisushi
Copy link
Author

I can confirm that this is still not supported

@dennisushi
Copy link
Author
>>> torch.tensor([1,2,3])[::-1]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: step must be greater than zero

I can confirm this is still not supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A request for a proper, new feature. module: advanced indexing Related to x[i] = y, index functions module: numpy Related to numpy support, and also numpy compatibility of our operators triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants
0