`ndarray::stack` changed behavior w.r.t layout between 0.15.1 and 0.15.2
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by running the issue's demonstration program with ndarray pinned to 0.15.2 and 0.15.3, then inspect the ndarray::stack implementation and its documentation. Determine whether the layout change is intended and whether the docs specify the returned layout. Done means the behavior is clarified through a fix or documentation update, with the reproduction covered.
Written by the indexing model from the issue text.
Description
Before 0.15.3, stack would return an array with C-layout when given C-layout views. But with 0.15.3, this behavior changed and now we get F-layout outputs. This demonstration program will succeed if you pin ndarray to "=0.15.2" and fail if you pin to "=0.15.3":
use ndarray::{arr2, stack, Axis};
fn main() {
// Here are some 2x3 arrays.
let a = arr2(&[[1, 2, 3], [4, 5, 6]]);
let b = &a * 2;
assert_eq!(a.shape(), b.shape());
assert_eq!(a.shape(), [2, 3]);
// When we stack them with Axis(2), we'll get a 2x3x4 array
// with the last dimension stored continuously.
let c = stack(Axis(2), &[a.view(), b.view(), a.view(), b.view()]).unwrap();
assert_eq!(c.shape(), [2, 3, 4]);
assert!(c.is_standard_layout());
dbg!(&c);
}
I don't see anything about the layout of stack's return value in the docs so I assumed that it would match the inputs. So even if no code behavior change is warranted, the docs should really include a note explaining that you might get a different layout than your inputs.
- Dominant language
- Rust
- Stars
- 4.3k
- Forks
- 391
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-ndarray/ndarray
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rust-ndarray/ndarray#1612 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rust-ndarray/ndarray#1617 · 1 comment ·
-
bug good first issue
Difficulty 3/5 1-2 days Newbie friendliness 68/100
rust-ndarray/ndarray#1615 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rust-ndarray/ndarray#1610 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
rust-ndarray/ndarray#1609 ·
All issues in rust-ndarray/ndarray
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100