-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
more powerful reverse(A; dims) #37367
Conversation
(There are certainly ways to speed this up further. Working out of place, for example, just doing |
|
PS. The inspiration for this PR was watching @3b1b doing awkward nested |
A quick benchmark: for
|
A thought: should something like |
Fixes #37358:
reverse(A; dims)
by passing a tuple fordims
dims=:
(reverse all dimensions) the default for multidimensionalA
. (Previously it was an error not to specifydims
) — similar tonumpy.flip
.reverse!(A; dims)
Array
andAbstractArray
implementationsreverse(A; dims)
for flipping a single dimension.Less code, does more, faster, backwards compatible — what's not to like?
To do:
OffsetArrays
test failures.