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

feat: Added ref method to TensorFlow Frontend #26316

Closed
wants to merge 7 commits into from

Conversation

ShruAgarwal
Copy link

@ShruAgarwal ShruAgarwal commented Sep 29, 2023

PR Description

Implemented an Instance Method named, ref to TensorFlow Frontend

Quick info about ref:
Returns a hashable reference object to the Tensor.
Example:

x = tf.constant(5)
x.ref()
True

I tested running the function over all backends but, unfortunately, it fails for all of them except for tensorflow. Later, I came to know that ref method or any such similar method doesn't exist in any other backend frameworks. 😅

Related Issue

Pending issue to be resolved #26516

Close #26140

Checklist

  • Did you add a function?
  • Did you add the tests?
  • Did you run your tests?
  • Did pre-commit not fail on any check?
  • Did you follow the steps we provided?

Please review the changes and let me know your thoughts if I'm correct or not. 🙏

Copy link
Contributor

@github-actions github-actions bot left a 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!

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on making your first Pull Request and thanks for supporting Ivy! 🎉
Join the conversation in our Discord

Here are some notes to understand our tests:

  • We have merged all the tests in one file called `display_test_results` job. 👀 It contains the following two sections:
    • Combined Test Results: This shows the results of all the ivy tests that ran on the PR. ✔️
    • New Failures Introduced: This lists the tests that fails on this PR.

Please make sure they are passing. 💪

Keep in mind that we will assign an engineer for this task and they will look at it based on the workload that they have, kindly be patient 😄.

@ShruAgarwal ShruAgarwal changed the title Added ref method to TensorFlow Frontend feat: Added ref method to TensorFlow Frontend Sep 29, 2023
@ivy-leaves ivy-leaves added the TensorFlow Frontend Developing the TensorFlow Frontend, checklist triggered by commenting add_frontend_checklist label Sep 29, 2023
Copy link
Contributor

@KareemMAX KareemMAX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, seems like you have changed docs/demos which you might have done by mistake. Can you revert that change because we can't merge with that change in place?

Copy link

@Kamalesh3112 Kamalesh3112 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the ref() function method for the code number lines 59, 60 and 61. It requires ref() method to be added into the code for Tensorflow Frontend application for the issue #26316

@@ -53,6 +53,9 @@ def shape(self):
def get_shape(self):
return tf_frontend.raw_ops.Shape(input=self)

def ref(self):
return self._ivy_array.ref()

def set_shape(self, shape):
if shape is None:
return

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def ref(self, shape):
if shape is None:
return self._ivy_array.ref()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Kamalesh3112
Thanks for reviewing! :)

But, according to the TensorFlow API docs, ref method doesn't have any parameters. 😅

Did you add that by mistake or does it point to something that needs to be improved?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the ref() method doesn't have any parameters and it has to be improved by adding those particular lines of code.

@ShruAgarwal
Copy link
Author

@KareemMAX Sorry for those extra revert commits as I'm learning to figure it out. 😅

Also, do the failed checks from above need to be resolved?

@NiteshK84
Copy link
Contributor

Hi @ShruAgarwal ,
please resolve the merge conflicts so we can proceed with your pull request.

1 similar comment
@NiteshK84
Copy link
Contributor

Hi @ShruAgarwal ,
please resolve the merge conflicts so we can proceed with your pull request.

@ShruAgarwal
Copy link
Author

Hi @ShruAgarwal , please resolve the merge conflicts so we can proceed with your pull request.

Hey @NiteshK84,
This pull request was made to solve issue #26140, but it has been closed as it was not a priority to be solved (months ago). Do you think I should still make changes? 😅

@KareemMAX
Copy link
Contributor

Hello,

I think this PR is unactive for a little while, so I'll close it for now. If you want to continue working on it in the future please feel free to open it and start working.

Thanks and happy contributing 😊

@KareemMAX KareemMAX closed this Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TensorFlow Frontend Developing the TensorFlow Frontend, checklist triggered by commenting add_frontend_checklist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ivy.ref ref
8 participants