-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
Solving issue #20221 #20237
Solving issue #20221 #20237
Conversation
… passed to compute_output_shape func in UnitNormalization Layer
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20237 +/- ##
=======================================
Coverage 79.38% 79.38%
=======================================
Files 501 501
Lines 47483 47503 +20
Branches 8718 8725 +7
=======================================
+ Hits 37694 37712 +18
- Misses 8025 8026 +1
- Partials 1764 1765 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There are similar issues for different layers like BatchNormalization, LayerNormalization, etc. So should I add validation checks similarily in those and commit into this PR itself or should I make seperate one for each of them? |
unsure if all norms can be / should be bundled together; if they do, it may be worth adding it here https://github.com/keras-team/keras/blob/master/keras/src/ops/operation_utils.py |
Enhanced the compute_output_shape method by adding validation for input shape types and axis bounds. The method now ensures that input_shape is either a list or tuple, and that all axis values are within the valid range of input dimensions. This provides clearer error handling and prevents potential issues during shape computation.
Reason for the Change: Previously, the compute_output_shape method did not validate the input shape type or check if the specified axes were within bounds. This could lead to ambiguous or delayed errors during dynamic execution when invalid input shapes or out-of-bound axes were used, leading to confusion for the user.
The updated validation improves robustness by catching these issues earlier in the process, providing more informative error messages to the user.
Hence solving the issue #20221