af::range fails with ERR_ARG #25
Answered
by
9prady9
jramapuram
asked this question in
Q&A
|
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 |
Answered by
9prady9
Aug 25, 2015
Replies: 3 comments
|
@9prady9 : Any thoughts? I don't see anything wrong with range() in data/mod.rs |
0 replies
|
@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 |
0 replies
Answer selected by
9prady9
|
Ah! Thanks, I thought it was the initial value to start the range from. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@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