Repository navigation
Preserve running normalization statistics for empty batches - #399
Merged
Denys88 merged 1 commit intoNov 21, 2026
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #399 +/- ##
=========================================
Coverage ? 58.21%
=========================================
Files ? 70
Lines ? 8866
Branches ? 0
=========================================
Hits ? 5161
Misses ? 3705
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Denys88
approved these changes
Nov 21, 2026
Denys88
left a comment
Owner
There was a problem hiding this comment.
Reviewed: small, targeted change with tests. Approving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A training-mode RunningMeanStd call on an empty leading batch computes undefined moments and writes them into the persistent normalization statistics. A later nonempty batch then inherits the damaged state.
Change
Skip the statistics update when input.size(0) is zero while retaining the normal forward/denormalization behavior. Add regressions covering empty inputs and subsequent normalization.
Validation
The regression run on the unchanged base recorded 4 failures and 4 passes. Targeted validation after the change recorded 17 passes.
CPU validation only; no accelerator or full training run is claimed.