`ndarray::stack` changed behavior w.r.t layout between 0.15.1 and 0.15.2
還沒有人認領這個 Issue。
評估
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Rust
- 星號
- 4.3k
- 分支
- 391
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
rust-ndarray/ndarray 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
rust-ndarray/ndarray#1612 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 48/100
rust-ndarray/ndarray#1617 · 1 則留言 ·
-
bug good first issue
難度 3/5 1-2 天 新手友好度 68/100
rust-ndarray/ndarray#1615 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 48/100
rust-ndarray/ndarray#1610 ·
-
難度 3/5 1-2 天 新手友好度 72/100
rust-ndarray/ndarray#1609 ·
查看 rust-ndarray/ndarray 的全部 Issue
相似的 Issue
-
risk:low runtime status:in-progress type:test
難度 1/5 1 小時以內 新手友好度 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 84/100
EricSpencer00/Resilient#4835 · 1 則留言 ·
-
agent:ready documentation
難度 2/5 1-3 小時 新手友好度 88/100
cesarferreira/stax#890 ·
-
bug
難度 1/5 1 小時以內 新手友好度 90/100