提交 dbb78494 编写于 作者: W WangXi 提交者: sandyhouse

fix var in c_reduce_sum

上级 17bd776e
...@@ -51,7 +51,8 @@ class GradientClipHelper(object): ...@@ -51,7 +51,8 @@ class GradientClipHelper(object):
if deperate_op: if deperate_op:
deperate_op_idx.add(idx) deperate_op_idx.add(idx)
for output_name in op.desc.output_arg_names(): for output_name in op.desc.output_arg_names():
deperated_vars.add(output_name) if output_name not in op.desc.input_arg_names():
deperated_vars.add(output_name)
if not deperated_vars: if not deperated_vars:
# got no gradient_clip op # got no gradient_clip op
...@@ -111,7 +112,6 @@ class GradientClipHelper(object): ...@@ -111,7 +112,6 @@ class GradientClipHelper(object):
to_check_param - should_check_param) to_check_param - should_check_param)
for var_name in deperated_vars: for var_name in deperated_vars:
if block.has_var(var_name): block._remove_var(var_name, sync=False)
block._remove_var(var_name, sync=False)
block._sync_with_cpp() block._sync_with_cpp()
return return
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册