SubArray: avoid invalid elimination of singleton indices#53228
SubArray: avoid invalid elimination of singleton indices#53228N5N3 merged 2 commits intoJuliaLang:masterfrom
Conversation
|
What if the last index is not singleton but, for example, 3? I fear it would be incorrectly removed from the list J'. |
|
Your concern would be took care by bounds checking. See Line 725 in d453af8 L159 only eliminates trailing singleton indices after all parent's dimensions have been consumed. |
|
Sorry, but because of CartesianIndex() bound checking will pass, and this is correct behavior. Example: If some extra axes are prepended, the trailing indices are not really "trailing", as they refer to real dimensions of a parent array. |
|
Yes, but @test A[CartesianIndices(()), :, 1] == @inferred(view(A, CartesianIndices(()), :, 1))is enough? |
|
Yes, you are right.
I've missed the point. |
Backported PRs: - [x] #53205 <!-- Profile: add notes to `print()` docs --> - [x] #53170 <!-- Remove outdated discussion about externally changing module bindings --> - [x] #53228 <!-- SubArray: avoid invalid elimination of singleton indices --> - [x] #51361 <!-- code_warntype docs: more neutral reference to @code_warntype --> - [x] #50480 <!-- Document --heap-size-hint in Command-line Interface --> - [x] #53301 <!-- Fix typo in `Sys.total_memory` docstring. --> - [x] #53354 <!-- fix code coverage bug in tail position and `else` --> - [x] #53388 <!-- Fix documentation: thread pool of main thread --> - [x] #53429 <!-- Subtype: skip slow-path in `local_∀_∃_subtype` if inputs contain no ∃ typevar. --> - [x] #53437 <!-- Add debug variant of loader_trampolines.o --> Need manual backport: - [ ] #52505 <!-- fix alignment of emit_unbox_store copy --> - [ ] #53373 <!-- fix sysimage-native-code=no option with pkgimages --> - [ ] #53439 <!-- staticdata: fix assert from partially disabled native code --> Contains multiple commits, manual intervention needed: - [ ] #52913 <!-- Added docstring for Artifacts.jl --> - [ ] #53218 <!-- Fix interpreter_exec.jl test --> Non-merged PRs with backport label: - [ ] #53424 <!-- yet more atomics & cache-line fixes on work-stealing queue --> - [ ] #53125 <!-- coverage: count coverage where explicitly requested by inference only --> - [ ] #52694 <!-- Reinstate similar for AbstractQ for backward compatibility --> - [ ] #51479 <!-- prevent code loading from lookin in the versioned environment when building Julia -->
…3228) close JuliaLang#53209 (cherry picked from commit 4d0a469)
close #53209