8000 ENH: CreateSortedStridePerm suboptimal · Issue #434 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
seberg opened this issue Sep 10, 2012 · 0 comments
Closed

ENH: CreateSortedStridePerm suboptimal #434

seberg opened this issue Sep 10, 2012 · 0 comments

Comments

@seberg
Copy link
Member
seberg commented Sep 10, 2012

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 then e[:,0:1,:] = 5. Also this means that e.copy('k') is not Fortran order, which maybe it never was, but seems not what one would expect.

seberg added a commit to seberg/numpy that referenced this issue Oct 21, 2012
This reverts changes done to CreateSortedStridePerm in commit
9194b3a. The problem is that it would fail for 3x1x3 Fortran order
array for example. And special handleing seems unnecessary at least
after 1-dim axis not mattering for contiguous flags.
This "closes Issue numpy#434"
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"
@seberg seberg closed this as completed Oct 25, 2012
teoliphant pushed a commit to ContinuumIO/numpy that referenced this issue Nov 6, 2012
This reverts changes done to CreateSortedStridePerm in commit
9194b3a. The problem is that it would fail for 3x1x3 Fortran order
array for example. And special handleing seems unnecessary at least
after 1-dim axis not mattering for contiguous flags.
This "closes Issue numpy#434"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0