-
Notifications
You must be signed in to change notification settings - Fork 716
Fix to use is_initializing
for init-detection.
#2486
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
Conversation
@levskaya was there a reason not to do the change proposed in this PR when you introduced |
@yotarok can you merge/rebase with |
a3b5a6d
to
1c6e197
Compare
@cgarciae Thanks for the comment. Rebased and force-pushed. |
Mostly I was overwhelmed and dropped it - Since it is a subtle change in semantics we need to test this against existing users to make sure we're not introducing a potentially invisible breaking change... and probably announce the behavior change. |
I agree, once this PR is approved, we (or Flax core devs) should announce the behavior change. |
Codecov Report
@@ Coverage Diff @@
## main #2486 +/- ##
==========================================
- Coverage 78.81% 78.76% -0.06%
==========================================
Files 48 48
Lines 5066 5068 +2
==========================================
- Hits 3993 3992 -1
- Misses 1073 1076 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Ping. |
@yotarok I'm going to run a large internal test suite to check if this breaks in surprising way. |
This doesn't cause any internal breakages, I think we can merge this |
What does this PR do?
The logic used for detecting initialization-mode in
linen.BatchNorm
is currently based on mutability ofparams
.There's a clean approach to do it by
Module.is_initializing
and the previous logic does not work if the user providesmutable=True
.Checklist
checks if that's the case).
discussion (please add a
link).
documentation guidelines.
(No quality testing = no merge!)
BatchNorm