-
Notifications
You must be signed in to change notification settings - Fork 58
Feature/add rows cols #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/index.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jramapuram We do not need to retrieve dimensions, just doing &[Seq::new(first, last, 1), Seq::default()] would be enough for this. This way one less ffi call in terms of input.dims().
Seq::default is the equivalent of af_span in C API of ArrayFire that spans all elements along that dimension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will refactor to span.
What about assertion of ranges? I.e. making sure first & last are contained within the max_rows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine i think, index call will return appropriate error code if something is wrong. I don't think we should duplicate error checks in rust wrapper unless absolutely required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
@jramapuram Can also please add slices wrapper, it would be exactly same except that the Seq using the parameters would be along third dimension. |
|
Cool will refactor to seq default & add span |
…l, set_rows, set_cols
|
@9prady9 : Refactored and added setters. Please review. |
|
👍 |
Upstream has:
rows()cols()Adding these to the wrapper.