-
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
feat: add broadcast_shape to paddle frontend #22977
Conversation
The test doesn't pass, and I can't figure out why. It says this:
But when I run the function in the shell, I get the same result from both functions.
Also, the function is supposed to allow you to input tuples or lists. I'm not sure how to test both of them in hypothesis. Do I have to sample from (list, tuple) with a strategy, and convert the shapes to that type? |
Thanks for contributing to Ivy! 😊👏 |
ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py
Outdated
Show resolved
Hide resolved
ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py
Outdated
Show resolved
Hide resolved
One of the assert statements modified lists in-place, which messed up the test. Also, the list was modified before being returned if test_values=False.
test_frontend_function wasn't checking list return values properly. I've tried to fix it. |
When using deepcopy, the type changes, which messes up the test. You can set shallow=True, and then the array isn't modified.
There are some tests failing because of types e.g. test_paddle_is_complex says. "Cannot convert to Paddle dtype. uint16 is not supported by Paddle." But I checked out previous commits, including the commit from just before I started this branch, and they fail for the same reason. Were these tests failing before, or have I set up my environment incorrectly? Also, I looked at the history of the main branch, and none of the commits in the last few weeks pass CI. So I'm confused about which tests I have to fix. |
can you please explain the changes you did in the testing files so @sherry30 can review them? |
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.
PR Compliance Checks Passed!
I've made some changes to |
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.
lets not move the test_values
if statement, what we should do instead is tuplify ret
as well so both ret
and frontend_ret
are both in tuples. This will make it easy to loop over the returns in the test function (Since some functions can also return tuples, so its easier to always return a tuple).
The other change looks good
Thanks
I've done it. I hope I've understood you correctly. |
# Conflicts: # ivy_tests/test_ivy/test_frontends/test_paddle/test_tensor/test_math.py
Ignore those last two commits. I was looking at the wrong function. |
test_paddle_tensor_unsqueeze gives the error I noticed that paddle has a problem with setting the dtype as bfloat16. It doesn't work if you use the dtype argument to the Tensor constructor (it sets the dtype to int64 instead). But it does work if you use astype.
Maybe this has something to do with the error. Should I try to fix it, or should I open an issue in the original paddle repository? I don't know how ivy converts to backend tensors, so I don't know how to fix it in ivy. |
Thank you for this PR, here is the CI results: This pull request does not result in any additional test failures. Congratulations! |
Hello, are you still working on this? |
Yes. Is it ready to merge? |
closing as duplicate of #23574 which was already merged |
Related Issue
Close #22919
Checklist