Fix bug in continuous apply, test=develop (#27337)

cancel_disable_ut
Yibing Liu 4 years ago committed by GitHub
parent f992f8d7ef
commit 34091533c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3570,8 +3570,10 @@ class ExponentialMovingAverage(object):
# bias correction
with layers.control_flow.Switch() as switch:
with switch.case(global_step > 0):
layers.assign(output=ema, input=ema / (1.0 - decay_pow))
layers.assign(input=ema, output=param)
layers.assign(
output=param, input=ema / (1.0 - decay_pow))
with switch.default():
layers.assign(output=param, input=ema)
self.restore_program = Program()
block = self.restore_program.global_block()

Loading…
Cancel
Save