| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Thanks Matti. |
Sorry, something went wrong.
| assert a[-1] == 11 # issue 24147 | ||
| assert a[1] == 2 | ||
| assert a[2] == 3 | ||
|
|
There was a problem hiding this comment.
An bad merge (locally) brought me here, but then I noticed that this can modify the original index array:
assert indxs[0] == -1
would fail. I think it shows that passing pointers or full offsets rather than indices makes more sense here (we need a temporary array anyway), but I have to think about how a hot-fix should look like.
Probably either need a local buffer here, or push the fixing into the indexed loop.
(Maybe local buffer is good, since that is what I would want to do with that hot-fix anyway in some form, even if it may make sense to push the buffer for that case slightly further up.)
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #24147
When avoiding the iter API for faster iteration, negative indexes need to be unwrapped.
Other places this is done in a similar way:
numpy/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
Lines 1683 to 1684 in c143f7b
numpy/numpy/core/src/multiarray/mapping.c
Lines 2281 to 2282 in c143f7b
numpy/numpy/core/src/multiarray/mapping.c
Lines 2335 to 2336 in c143f7b
Test added that failed before, passes after