af::range fails with ERR_ARG #25
-
Code: let dims = Dim4::new(&[128, 1, 1, 1]);
af::print(&af::range(dims, 128, af::Aftype::F32).unwrap()); Result: thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: ERR_ARG', src/libcore/result.rs:731 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
@9prady9 : Any thoughts? I don't see anything wrong with range() in data/mod.rs |
Beta Was this translation helpful? Give feedback.
-
@jramapuram Check the Rust doc for this function here. The problem is with the second argument which is a dimension specifier - takes values 0, 1, 2, 3 I just created the skeleton documentation today and will keep updating the rust wrapper documentation once we figure how to use content (as much as possible) from C++ docs in rust docs. Assuming you wanted to create an array of size 128x128 with sequenced values along 1st dimension.
that would give the following output
|
Beta Was this translation helpful? Give feedback.
-
Ah! Thanks, I thought it was the initial value to start the range from. |
Beta Was this translation helpful? Give feedback.
@jramapuram Check the Rust doc for this function here.
C++ documentation is here
The problem is with the second argument which is a dimension specifier - takes values 0, 1, 2, 3
I just created the skeleton documentation today and will keep updating the rust wrapper documentation once we figure how to use content (as much as possible) from C++ docs in rust docs.
Assuming you wanted to create an array of size 128x128 with sequenced values along 1st dimension.
it should be the following
that would give the following output