ivy icon indicating copy to clipboard operation
ivy copied to clipboard

Added torch.norm in the functional frontend

Open AmgadHasan opened this issue 1 year ago • 8 comments

  • Implemented the torch.norm function in ivy/functional/frontends/torch/linalg.py

  • Implemented a test for it named test_torch_norm in ivy_tests/test_ivy/test_frontends/test_torch/test_linalg.py

Close #11936

AmgadHasan avatar Jun 14 '23 21:06 AmgadHasan

Hey @AmgadHasan! Thanks for contributing! I left a quick review on line 107 of ivy_tests/test_ivy/test_frontends/test_torch/test_linalg.py could you please fix that and then run the tests? It looks like the testing functions may generate an invalid combination of arguments such as:

x = array([[[-1.]]], dtype=float32)
ord = 1
keepdim = False

Could you please fix those issues as well and make sure the tests are passing? Other than that the PR seems to be in good shape!

Feel free to ask any questions! Thanks! :)

danielmunioz avatar Jun 18 '23 21:06 danielmunioz

Hey @AmgadHasan! Thanks for contributing! I left a quick review on line 107 of ivy_tests/test_ivy/test_frontends/test_torch/test_linalg.py could you please fix that and then run the tests? It looks like the testing functions may generate an invalid combination of arguments such as:

x = array([[[-1.]]], dtype=float32)
ord = 1
keepdim = False

Could you please fix those issues as well and make sure the tests are passing? Other than that the PR seems to be in good shape!

Feel free to ask any questions! Thanks! :)

Hello Daniel

Thank you for reviewing my PR. However, I can't find your review of line 107 in the test module. I can't find any comments on that file.

AmgadHasan avatar Jun 20 '23 00:06 AmgadHasan

Hey @AmgadHasan! You can find the review by going to the 'Files Changed' tab here on Github, I'll ping you there as well

danielmunioz avatar Jun 20 '23 03:06 danielmunioz

Hey @AmgadHasan! You can find the review by going to the 'Files Changed' tab here on Github, I'll ping you there as well

Hello @danielmunioz I checked and still can't find it.

Here's what it looks like to me image

AmgadHasan avatar Jun 20 '23 17:06 AmgadHasan

That's so weird 🤔, I can see it on my end, guess it's just a github bug then Anyways, for line 107 of ivy_tests/test_ivy/test_frontends/test_torch/test_linalg.py the name of the input argument there should be 'A' instead of 'tensor', those testing arguments should match the function ones so that the test suite is able to properly recognize them

After that could you please run the test and make sure it's passing for your function?

If you have any questions please feel free to reach out! :) Thanks!

danielmunioz avatar Jun 21 '23 02:06 danielmunioz

I found that this pull request https://github.com/unifyai/ivy/pull/17454 is also dealing with this task. It seems like there are some misunderstanding here.

Daniel4078 avatar Jun 21 '23 10:06 Daniel4078

I found that this pull request #17454 is also dealing with this task. It seems like there are some misunderstanding here.

Hmm. Anna said the pr was linked to the issue and I could start working on the pr

AmgadHasan avatar Jun 21 '23 15:06 AmgadHasan

@danielmunioz Looks like my PR finally passed all test! Do you have any more changes or feedback?

AmgadHasan avatar Jun 21 '23 16:06 AmgadHasan

Hey @AmgadHasan, sorry but the tests are not passing yet, could you please run them locally and make sure they're passing? The github are random across the repo and examples so they sometimes miss some important cases, that's why we always try to get the test passing locally first, for example, to run this test only in a command line you can try: pytest /workspaces/ivy/ivy_tests/test_ivy/test_frontends/test_torch/test_linalg.py::test_torch_norm.

Also, we should add more parameters to the testing values of ord such as -1 and -2, as the original implementation seems to be able to handle those!

If there you have any questions feel free to reach out! Thanks!

danielmunioz avatar Jun 21 '23 20:06 danielmunioz

This PR has been labelled as stale because it has been inactive for more than 7 days. If you would like to continue working on this PR, then please add another comment or this PR will be closed in 7 days.

ivy-seed avatar Jul 01 '23 05:07 ivy-seed

This PR has been closed because it has been marked as stale for more than 7 days with no activity.

ivy-seed avatar Jul 10 '23 05:07 ivy-seed