-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
ENH: CreateSortedStridePerm suboptimal #434
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
Comments
seberg
added a commit
to seberg/numpy
that referenced
this issue
Oct 23, 2012
This changes CreateSortedStridedPerm to not use the shape for special casing 1-dim axis. The cleanup does not seem to be useful in most cases and the current way is buggy. Also insert stride so that reduce with keepdims=1 will keep contiguous arrays contiguous. "Closes Issue numpy#434"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The CreateSortedStridePerm does not work correctly when it comes to non C ordered arrays that include a 1 dimensional axis somewhere in the middle (and are not contiguous as this is typically optimized anyways). Its a corner case, but since I noticed thought I would post it.
For these cases it will fail to sort the array and this results unnecessarily slow operations for some things. (IE:
e = np.empty(400,400,400)[::2,::2,::2]; e[:,0,:] = 5
) is much faster thene[:,0:1,:] = 5
. Also this means thate.copy('k')
is not Fortran order, which maybe it never was, but seems not what one would expect.The text was updated successfully, but these errors were encountered: