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

r2.15 cherry-pick: e44f8a08051 "check hasattr on the type, not the instance." #62308

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

tensorflow-jenkins
Copy link
Collaborator

Refer to the original commit: e44f8a0

hasattr on the instance triggers __getattr__ which carries very undesirable
effects, such as running Ops on a donated buffer.

Long term, we may want to audit all uses of hasattr on TensorFlow instances
that overrides __getattr__ in nontrival (e.g. running tf Ops) ways. They will
almost always cause trouble here and there because TensorFlow is quite far
from being able guarantee if an Op returns or consumes is actually valid in all cases. Things will improve give it time, but if we can avoid such strong assumptions the system tend to get more robust.

PiperOrigin-RevId: 578261984
@learning-to-play learning-to-play merged commit 2a4ec94 into r2.15 Nov 2, 2023
9 of 11 checks passed
@learning-to-play learning-to-play deleted the r2.15-e44f8a08051 branch November 2, 2023 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants