-
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
fix(layers): Fix incorrect masked mean/variance in BatchNormalization layer #20815
fix(layers): Fix incorrect masked mean/variance in BatchNormalization layer #20815
Conversation
harshaljanjani
commented
Jan 27, 2025
- Update masked moments calculation to properly account for broadcast dimensions when summing mask weights.
- Added test to verify broadcast mask handling produces zero-centered outputs.
- Fixes BatchNormalization gives incorrect output with masked inputs > 3 dimensions #19848.
… layer Update masked moments calculation to properly account for broadcast dimensions when summing mask weights. Added test to verify broadcast mask handling produces zero-centered outputs.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #20815 +/- ##
==========================================
- Coverage 82.01% 82.01% -0.01%
==========================================
Files 558 559 +1
Lines 52182 52291 +109
Branches 8067 8084 +17
==========================================
+ Hits 42795 42884 +89
- Misses 7421 7431 +10
- Partials 1966 1976 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
The error is in the line in |
- Convert tuple reduction axes to list format for compatibility with OpenVINO's constant op - Remove OpenVINO skip decorator after fixing axis format
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 fix!
Avoid repeated type checks and conversions during forward pass.
@fchollet I know it's been a long PR with the |
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