ivy icon indicating copy to clipboard operation
ivy copied to clipboard

Make `Numpy` args compitable with `torch` function.

Open akshatvishu opened this issue 1 year ago • 4 comments

Close #17950

Also, fixed squeeze method not getting properly called at torch_frontend.median implementation.

As discussed with @AnnaTz ; to provide the same compatibility that torch offers within its framework to allow Numpy args as an alias for torch args, we want to add the same functionality to ivy.

Currently, this checks compatibility for all functions at ivy/functional/frontends/torch/reduction_ops.py

akshatvishu avatar Jun 28 '23 15:06 akshatvishu

I'd say you can go ahead and add the decorator to all torch frontend functions that have an aliased argument.

AnnaTz avatar Jun 28 '23 15:06 AnnaTz

One ore thing, ideally we would like to have a test for the decorator as well. You can have a look at the rest of the func_wrapper tests I have implemented if you'd like to do this yourself. Otherwise I can do this.

AnnaTz avatar Jun 28 '23 16:06 AnnaTz

One ore thing, ideally we would like to have a test for the decorator as well. You can have a look at the rest of the func_wrapper tests I have implemented if you'd like to do this yourself. Otherwise I can do this.

The test for it should be added at ivy_tests/test_ivy/test_misc/test_func_wrapper.py ?

akshatvishu avatar Jun 28 '23 18:06 akshatvishu

One ore thing, ideally we would like to have a test for the decorator as well. You can have a look at the rest of the func_wrapper tests I have implemented if you'd like to do this yourself. Otherwise I can do this.

The test for it should be added at ivy_tests/test_ivy/test_misc/test_func_wrapper.py ?

ivy_tests/test_ivy/test_frontends/test_torch/test_func_wrapper.py

AnnaTz avatar Jun 29 '23 09:06 AnnaTz

Hey @AnnaTz , thanks for the review and all the suggestions! Had a blast working on this one. Going to do a double-check on the rest of the files at torch_frontend to make sure I didn't skip over anything. Catch you in the next PR!

akshatvishu avatar Jul 04 '23 10:07 akshatvishu