-
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
feat: add cpu function #21255
feat: add cpu function #21255
Conversation
Thanks for contributing to Ivy! 😊👏 |
Hi Thank you for your effort, since this is a frontend function, you need to implement it in the frontend folder and add the related tests, to do that you need to read the documentation or check other examples, The related docs: |
Hello, |
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.
Thanks for adding the tests, but can you check the implementation of the function again? the location is not correct and you need to follow the examples in the guide it will direct you.
Hello, |
Hi @Prajyot70 I believe that this function should be added to the |
Hello, |
Hi @Prajyot70, glad I could help. It looks like the |
Hello,
Please have a look at them and let me know your insights. |
Hello @JPGoodale , |
Hey @Prajyot70, |
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.
PR Compliance Checks Passed!
Hello @NripeshN , |
Hello @NripeshN , |
Hey @Prajyot70 |
Hi @Prajyot70 |
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. |
@@ -633,6 +633,16 @@ def acos_(self): | |||
self.ivy_array = self.acos().ivy_array | |||
return self | |||
|
|||
@to_ivy_arrays_and_back | |||
def to_cpu(self): |
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.
Use correct name as mentioned in open issues list here: #3612 or here in original functions here https://pytorch.org/docs/stable/generated/torch.Tensor.cpu.html#torch.Tensor.cpu.
@@ -7831,6 +7837,55 @@ def test_torch_index_select( | |||
) | |||
|
|||
|
|||
#cpu | |||
@handle_frontend_method | |||
class TestTorchInstanceToCPU(unittest.TestCase):( |
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.
why have you implemented the test in this fashion, any reason?
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.
If not, stick to the way other test functions are implemented.
Thanks
if __name__ == "__main__": | ||
unittest.main() | ||
|
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.
I think these lines are unnecessary.
Hello @Sarvesh-Kesharwani , |
I am closing this as there are many issues still there pointed out by @a0m0rajab @JPGoodale @Sarvesh-Kesharwani above. The requested changes are not made, the implementation has a different name than the actual torch method and the tests are chosen to be implemented differently than other examples. Please follow our Contributing page for further details. Thanks for the efforts all |
close #21086