-
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
Torch/Paddle adaptive_max_pool2d #21247
Torch/Paddle adaptive_max_pool2d #21247
Conversation
to torch frontend, ivy experimental API, and torch and paddle experimental backends. Also adds unit tests and makes a small optimisation to ivy.adaptive_avg_pool2d.
Paddle's implementation of adaptive_max_pool2d is not numerically stable, for some reason, with very large numbers so I had to put a minimum and maximum value in the test cases.
Thanks for contributing to Ivy! 😊👏 |
Well, you should implement the backend of this function for all the other frameworks in the experimental module as now all the relevant tests are failing left and right. In addition, I suppose adaptive_max_pool2d should not be placed in the experimental module in the first place and you should either implement it compositionally using existing ivy functions or ask ivy members to create the missing ivy.adaptive_max_pool2d function with complete backend support for you to use. |
@Daniel4078 What happened to prompt this comment? This PR is over a month old. To address your concerns:
I implemented it as a mixed function so that it works for all backends. At the time that I merged this, the tests for it were passing both locally and in the CI.
On what basis? My understanding was that new functions always go into
I am an ivy member, so I created the missing function myself |
Oh, thank you for your notice, then can you please look that the failing tests of your function as you probably know what went wrong better than me. like adaptive_max_pool2d was failuring for multiple errors like AssertionError: the results from backend jax and ground truth framework torch do not match: [[[0.]]]!=[[[1.]]] for the one in experimental while there is another test with similar name torch_adaptive_max_pool2d suffers from AssertionError: returned dtype = float32, ground-truth returned dtype = bfloat16 in jax backend and RuntimeError: "adaptive_max_pool2d" not implemented for 'Half' for jax backend at the same time |
Closes #21224
Adds
adaptive_max_pool2d
to the torch frontend, and also to Ivy's functional API (under the experimental folder). The only other frontend (as far as I could tell from a quick Google) to have an implementation ofadaptive_max_pool2d
is paddle, so I added it to that frontend as well, along with those two backends.