Skip to content
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

Add any() to torch frontend #9439

Merged
merged 5 commits into from
Jan 8, 2023
Merged

Conversation

jaketae
Copy link
Contributor

@jaketae jaketae commented Jan 6, 2023

Close #9438

@ivy-leaves ivy-leaves added the PyTorch Frontend Developing the PyTorch Frontend, checklist triggered by commenting add_frontend_checklist label Jan 6, 2023
@jaketae
Copy link
Contributor Author

jaketae commented Jan 6, 2023

Hello @simonetgordon, the test seems to be failing due to

  • AttributeError: module 'ivy_tests.test_ivy.helpers' has no attribute 'array_or_none'
  • IndentationError: unexpected indent

Link to the CI job. I'm able to locally reproduce the error, both on my branch and master, via

pytest ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py -k 'test_torch_instance_any'

I've addressed the first error in #9442, but it's unclear to me where the second IndentationError is occurring. I'd appreciate any pointers!

@jaketae jaketae marked this pull request as ready for review January 6, 2023 09:36
@simonetgordon
Copy link
Contributor

simonetgordon commented Jan 6, 2023

Hello @simonetgordon, the test seems to be failing due to

  • AttributeError: module 'ivy_tests.test_ivy.helpers' has no attribute 'array_or_none'
  • IndentationError: unexpected indent

Link to the CI job. I'm able to locally reproduce the error, both on my branch and master, via

pytest ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py -k 'test_torch_instance_any'

I've addressed the first error in #9442, but it's unclear to me where the second IndentationError is occurring. I'd appreciate any pointers!

Thanks so much for raising an issue on the first issue. Your solution looks good but it's best that @CatB1t approves it before merging. The indentation error looks like it's def sqrt(self): in frontends/torch/tensor.py but upon inspecting it I'm not sure why an indentation error would be raised, it looks aligned. Perhaps it is related to other torch frontend errors.

In any case, it is not your responsibility to fix all of these issues in order to get your PR merged. Perhaps try to comment out the other functions in tensor.py and the corresponding test file and then check the PR checks to see if your addition runs OK. Also, the errors look like they are coming from other functions/tests in tensor.py and not yours, so I'm unsure why you encounter these errors when running pytest ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py -k 'test_torch_instance_any' locally. Perhaps try another test running mechanism to see if that passes?

@jaketae
Copy link
Contributor Author

jaketae commented Jan 6, 2023

Hello @simonetgordon, thanks for the comment.

It appears that test_torch_instance_sqrt was the culprit. As you said, I'm not sure why the run was being affected by other tests even with the -k flag. In any case, I commented out that particular test and was able to run and pass the test case successfully.

collected 236 items / 234 deselected / 2 selected                                                                          

ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py ..                                                       [100%]

===================================================== warnings summary =====================================================
ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py: 50 warnings
  /data/lily/jt856/documents/ivy/ivy_tests/test_ivy/helpers/function_testing.py:1457: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
    ins_gt = frontend_creation_fn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====================================== 2 passed, 234 deselected, 50 warnings in 6.76s ======================================

Let me know if anything seems off. Thanks!


Edit: I opened #9450 to fix the failing sqrt() test, so all test-related issues are on track to being resolved!

@simonetgordon
Copy link
Contributor

lgtm!

@simonetgordon simonetgordon merged commit 9a44f10 into ivy-llc:master Jan 8, 2023
NouranYoussef pushed a commit to NouranYoussef/ivy that referenced this pull request Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PyTorch Frontend Developing the PyTorch Frontend, checklist triggered by commenting add_frontend_checklist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

any
3 participants