Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

sabre-code
Copy link
Contributor

Added paddle.sum frontend function. Wrote tests for it.

Fixes #22770

@github-actions
Copy link
Contributor

Thanks for contributing to Ivy! 😊👏
Here are some of the important points from our Contributing Guidelines 📝:
1. Feel free to ignore the run_tests (1), run_tests (2), … jobs, and only look at the display_test_results job. 👀 It contains the following two sections:
- Combined Test Results: This shows the results of all the ivy tests that ran on the PR. ✔️
- New Failures Introduced: This lists the tests that are passing on main, but fail on the PR Fork. Please try to make sure that there are no such tests. 💪
2. The lint / Check formatting / check-formatting tests check for the formatting of your code. 📜 If it fails, please check the exact error message in the logs and fix the same. ⚠️🔧
3. Finally, the test-docstrings / run-docstring-tests check for the changes made in docstrings of the functions. This may be skipped, as well. 📚
Happy coding! 🎉👨‍💻

@ivy-leaves ivy-leaves added the Paddle Frontend Developing the Paddle Frontend, checklist triggered by commenting add_frontend_checklist label Aug 30, 2023
@sabre-code
Copy link
Contributor Author

@yopknopixx hello please review my PR.

@shubhamb-22
Copy link

@sabre-code I see a lot of new failures introduced by your PR. https://github.com/unifyai/ivy/actions/runs/6021337957?pr=22771

@sabre-code
Copy link
Contributor Author

@shubhamb-22 I guess they are from some other functions. Can you check code.

@sabre-code
Copy link
Contributor Author

@shubhamb-22 Please guide with possible issue. This is my first PR here.

@yopknopixx
Copy link
Contributor

@sabre-code I will go through it shortly

@sabre-code
Copy link
Contributor Author

@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. :)

@ivy-llc ivy-llc deleted a comment from shubhamb-22 Aug 31, 2023
)
@to_ivy_arrays_and_back
def sum(x, axis=None, keepdim=False, name=None):
if x.dtype == ivy.int32:
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

@sabre-code sabre-code requested a review from yopknopixx August 31, 2023 19:38
@Omar88magdy
Copy link
Contributor

hey sabre-code,
i want to inform you that i've been working on (sum) function before you and i 've already implemented it.
thank you.

@yopknopixx
Copy link
Contributor

Hi @sabre-code ,

Thanks for the PR!
However, since there is an earlier PR for the issue, I will be closing this one. Given that you have completed the implementation, you can submit this PR as part of the application process.

Thanks!

@yopknopixx yopknopixx closed this Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Paddle Frontend Developing the Paddle Frontend, checklist triggered by commenting add_frontend_checklist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sum
5 participants