Empty Array lead to "The strides must not allow any element to be referenced by two different indices"
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
Start with the dim_stride_overlap function identified in the issue and reproduce both ArrayView2::from_shape_ptr examples, including the (1, 0) shape with (0, 0) strides. Done means empty arrays with either zero dimension are accepted consistently, while non-empty overlapping strides continue to be rejected.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I tried to create an empty array with the following command:
let shape = (1, 0).strides((0, 0));
let ptr = std::ptr::dangling::<f64>();
unsafe { ArrayView2::from_shape_ptr(shape, ptr) }
It fails with "The strides must not allow any element to be referenced by two different indices".
But the slightly different code works:
let shape = (0, 1).strides((0, 0));
let ptr = std::ptr::dangling::<f64>();
unsafe { ArrayView2::from_shape_ptr(shape, ptr) }
My expectation would be that both variants work fine.
I think the bug is inside dim_stride_overlap, which fails before the first 0 dimension is found and therefore recognises that the complete array is empty.
By the way, I use (0, 0) strides, since ndarray does the same for empty array e.g. created via zeros function.
- Lingua principale
- Rust
- Stelle
- 4.3k
- Fork
- 391
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-ndarray/ndarray
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
rust-ndarray/ndarray#1612 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rust-ndarray/ndarray#1617 · 1 commento ·
-
Stack overflow in `triu` Apertabug good first issue
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
rust-ndarray/ndarray#1615 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rust-ndarray/ndarray#1610 ·
-
breaking-change enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
rust-ndarray/ndarray#1591 · 2 commenti ·
Tutte le issue di rust-ndarray/ndarray
Issue simili
-
Accept -c in more positions Apertaarea: compat bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
area: dogs bug priority: P3 silent failure test-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
MystenLabs/sui#28056 · 1 commento ·
-
type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Luminous-Dynamics/mycelix#2577 ·