returned pyarray not able to convert to vec
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 141
- Avg merge
- 16m
- Merged PRs (30d)
- 3
Description
my code:
let inverted = test
.call1(PyTuple::new_bound(py, &[a]))
.unwrap()
.downcast_into::<PyArray3<u8>>()
.unwrap();
println!(
"inverted shape: {:?}, len: {}",
inverted.shape(),
inverted.len()
);
let v = inverted.to_vec().unwrap();
println!("inverted vector size: {:?}", v.len());
output:
inverted shape: [360, 640, 3], len: 691200
thread 'main' panicked at src/main.rs:117:46:
called `Result::unwrap()` on an `Err` value: NotContiguousError
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
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.
Research direction
Start with src/main.rs at line 117 and the PyArray3 conversion shown in the report. Reproduce the NotContiguousError from to_vec() and inspect the reported array shape, length, and contiguity. Done means documenting or confirming the supported behavior for converting this returned array to a vector.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, rust
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100