-
Notifications
You must be signed in to change notification settings - Fork 19.4k
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
Prevent setting attributes on KerasTensor
#19920
Prevent setting attributes on KerasTensor
#19920
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #19920 +/- ##
==========================================
- Coverage 79.02% 78.98% -0.05%
==========================================
Files 499 499
Lines 46436 46513 +77
Branches 8548 8561 +13
==========================================
+ Hits 36695 36737 +42
- Misses 8015 8044 +29
- Partials 1726 1732 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 the PR. In what cases would we set these attributes? Shouldn't these properties be immutable, like they are for a concrete tensor?
Sometimes, it is convenient to change them inplace in Lines 105 to 119 in d318fc7
keras/keras/src/dtype_policies/dtype_policy.py Lines 162 to 165 in d318fc7
Or should these be considered inappropriate? |
I would say it's better to create a new |
Got it. Let me try to fix them. |
2fef3bf
to
5d3aec2
Compare
KerasTensor
KerasTensor
6e57ab6
to
f25027c
Compare
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 the update!
f25027c
to
93b191f
Compare
I've added a clearer error msg for the setters of KerasTensor. |
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.
LGTM, thank you!
This PR should improve consistency when using
KerasTensor