未验证 提交 7ae10900 编写于 作者: M mapingshuo 提交者: GitHub

fix slow var initialize, test=develop (#26516)

上级 5407e327
......@@ -4929,6 +4929,11 @@ class LookaheadOptimizer(object):
mod = layers.elementwise_mod(step, k)
with layers.control_flow.Switch() as switch:
with switch.case(step == one_var):
for param_name in params:
fast_var = main_block.var(param_name)
slow_var = param_to_slow[param_name]
layers.assign(input=fast_var, output=slow_var)
with switch.case(mod == zero_var):
for param_name in params:
fast_var = main_block.var(param_name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册