Skip to content

af::range fails with ERR_ARG #25

Answered by 9prady9
jramapuram asked this question in Q&A
Discussion options

You must be logged in to vote

@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

af::print(&af::range(dims, 1, af::Aftype::F32).unwrap());

that would give the following output

0 1 2 .... 127
0 1 2 .... 127
0 1 2 .... 127
.
.
.
0 1 2 .... 127

Replies: 3 comments

Comment options

jramapuram
Aug 25, 2015
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by 9prady9
Comment options

jramapuram
Aug 25, 2015
Collaborator Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #25 on December 09, 2020 05:00.