-
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
P var #18995
P var #18995
Conversation
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.
Hi! I could be missing something obvious, but I'm not too sure why we're updating the paddle/tensor/stat.py file here? 🤔
Apart from that, could you take care of the lint error? Hope this helps - https://unify.ai/docs/ivy/overview/contributing/setting_up.html#pre-commit 😄
hey @rishabgit sorry for the late reply i was busy in my acadamic work for last week. Now i am solving the lint error and merge conflict. and i am implemented the var method first in stat file in paddle frontend because when i am try to call the ivy.var directly in tensor.py file it giving me error in testing. so i implemented that in stat first. thank you |
redundant wrapping through stat.py
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.
Hey @MahmoudAshraf97, sorry about tagging on a paddle issue 😥 -
paddle var supports float16
But ivy's backend implementation of var calls _std
that calls paddle's mean which doesn't support float16
(docs) and throws an error during the testing.
What should be ideally done for this? I don't think removing float16
from the frontend is the way to go, and I'm sure there's some decorator that handles this case that I'm ignorant of, so thought best to cc you here 😄
PS: @samthakur587 I don't think wrapping the var through the stats file is necessary here and also noticed the supported dtyes needed an update, so I made the changes to minimize the overhead of back and forth.
In case you're aware of a workaround for the issue above, feel free to chime in since you'd have the best knowledge with the deep dive you've done for this task, thanks! 😄
Hi @rishabgit , |
Hey @rishabgit sorry for the late reply. i am busy last week in my academics work. and now i have seen that the paddle version is updated to 2.5.1 and i have update the version and now i am doing the local test for the function. and as the @MahmoudAshraf97 suggested i am removed the float16 dtype. because the mean does not supported the float16. thank you |
Hey @rishabgit i am testing this in local and i got stuck in this error . Is there any problem with writing the test function or the actual method 'var ' in tensor.py can you please check and let me know where is the problem. thank you |
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.
Hi, you'll have to add backend_fw
arg in testing fn
I'm getting the same error that you reported - ivy.utils.exceptions.IvyBackendException: numpy: nested_map: numpy: nested_map: isinstance() arg 2 must be a type, a tuple of types, or a union
I'll suggest syncing your branch with latest ivy updates since there have been a lot of changes in the testing pipeline recently, which could be the culprit here
Feel free to re-request review after making these changes, thanks! 😄
hey @rishabgit i am tried to solve this error many time but still it is coming. i know the problem is in my test function but i am not getting where is this. can you please check because i try every method like in place of using the _statistical_dtype_values i used try this dtype_x_axis=helpers.dtype_values_axis(
available_dtypes=st.one_of(helpers.get_dtypes("float")),
min_axis=-1,
max_axis=0,
min_num_dims=1,
force_int_axis=True,
), but it also giving the same error. thank you |
Hi! Sorry about the delay, will come back to this soon! |
Tests were failing due to unrelated issues which were recently fixed. I tested your code on latest ivy and everything passes. Thanks for adding this! 😄 |
Co-authored-by: Rishab Mallick <rishabmallick6@gmail.com>
Close #18302