'into_shape()' incompatible memory layout error
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the reproducer in src/env.rs around the reported line and run env::test::ndarray_into_shape_test. Compare the memory layouts of the contiguous array and the sliced view before into_shape((3, 1)). Done means explaining why the same Rust type behaves differently and resolving or clearly documenting the incompatible-layout behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
let d = aview1(&[1., 2., 3., 4.]);
let d = d.into_shape((2, 2)).unwrap();
println!("d shape {:?}", &d.shape());
let a = array![
[110., 120., 130., 140.,],
[210., 220., 230., 240.,],
[310., 320., 330., 340.,],
];
let a = a.slice(s![.., 1]);
let a = a.into_shape((3, 1)).unwrap();
println!("a {:?}", &a);
println!("a shape {:?}", &a.shape());

running 1 test
d shape [2, 2]
thread 'env::test::ndarray_into_shape_test' panicked at 'called `Result::unwrap()` on an `Err` value: ShapeError/IncompatibleLayout: incompatible memory layout', src\env.rs:483:38
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test env::test::ndarray_into_shape_test ... FAILED
Both d and a is same type but panic occurs.
Is there any reason why they behave differently?
(slice_mut, slice_move, clone() also shows same error)
- 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 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
rust-ndarray/ndarray#1609 ·
Tutte le issue di rust-ndarray/ndarray
Issue simili
-
risk:low runtime status:in-progress type:test
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
EricSpencer00/Resilient#4835 · 1 commento ·
-
agent:ready documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
cesarferreira/stax#890 ·
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100