Skip to content

Fix second argument of reorder API to be more clear #203

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

Merged
merged 3 commits into from
Sep 29, 2019

Conversation

9prady9
Copy link
Member

@9prady9 9prady9 commented Sep 23, 2019

Fixes #202

@srenevey How about the updated API ? Also, do take a look at how new API handles it's second argument.

Copy link

@srenevey srenevey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good. Two comments though.

  1. In the method's comment, it is mentioned: "The default order of axes in ArrayFire is axis with smallest distance between adjacent elements...". Do you mean smallest distance between memory blocks where the array is stored ? If so it might be worth mentioning it explicitly so as to not confuse anyone with "mathematical distance" such as norm.

  2. For the second argument, what is the purpose of using Option<Vec> instead of Vec ? In what situation would someone call reorder(&input, None) ?

Thanks for the prompt fix.

@9prady9
Copy link
Member Author

9prady9 commented Sep 23, 2019 via email

@9prady9
Copy link
Member Author

9prady9 commented Sep 28, 2019

@srenevey I think it is more clear now. please have a look.

Changing only one axis doesn't make sense, so I am debating if I take vec4 altogether or what I have now. At least two axes are to be swapped, hence we have two mandatory u64 arguments and then an optional vec of u64's. This way, even if we change max dims support from ArrayFire, we can avoid any change in rust wrapper API.

Copy link

@srenevey srenevey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. If you'd rather have the the signature that you've proposed I'll gladly approve the changes.

@9prady9 9prady9 merged commit cef7538 into arrayfire:master Sep 29, 2019
@9prady9 9prady9 deleted the fix_reorder_api branch September 29, 2019 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix reorder documentation for second argument
2 participants