-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
added paddle.sum frontend and test for it #22771
Conversation
Thanks for contributing to Ivy! 😊👏 |
@yopknopixx hello please review my PR. |
@sabre-code I see a lot of new failures introduced by your PR. https://github.com/unifyai/ivy/actions/runs/6021337957?pr=22771 |
@shubhamb-22 I guess they are from some other functions. Can you check code. |
@shubhamb-22 Please guide with possible issue. This is my first PR here. |
@sabre-code I will go through it shortly |
@yopknopixx hello, did you check code, do I need to change anything. Please let me know if there is anything. :) |
) | ||
@to_ivy_arrays_and_back | ||
def sum(x, axis=None, keepdim=False, name=None): | ||
if x.dtype == ivy.int32: |
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.
What is the reason for doing this?
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.
@yopknopixx the paddle documentation says if the dtype of input array is int32 the output dtype should be int64. ivy.sum does not cover this edge case and if this dtype conversion is not done all tests fail with "expected dtype int64 got int32". to address this issue this is done. Thanks
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.
@yopknopixx I rechecked and found that even when input array dtype is bool paddle.sum converts it to int64, I have added condition for that too. and ivy.sum documentation says whenever such expected dtype is different from dtype of array we have to convert the dtype to desired type before passing to the function. so added code to do that too.
hey sabre-code, |
Hi @sabre-code , Thanks for the PR! Thanks! |
Added paddle.sum frontend function. Wrote tests for it.
Fixes #22770