提交 a7c6bf77 编写于 作者: W wanghaoshuang

Change do_model_average_for_mean_and_var to boolean in batch_normal.

上级 2e40660e
......@@ -1518,9 +1518,6 @@ def batch_norm(input,
bias = helper.create_parameter(
attr=helper.bias_attr, shape=param_shape, dtype=dtype, is_bias=True)
if do_model_average_for_mean_and_var:
do_model_average_for_mean_and_var = None
mean = helper.create_parameter(
attr=ParamAttr(
name=moving_mean_name,
......
......@@ -853,6 +853,7 @@ class ModelAverage(Optimizer):
self.params_grads = [] if params_grads is None else params_grads
params = {}
for param, grad in self.params_grads:
if param.do_model_average != False:
params[param.name] = (param, grad)
for param in framework.default_main_program().global_block(
).all_parameters():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册