未验证 提交 65dd7ec2 编写于 作者: Z Zeng Jinle 提交者: GitHub

add clear ops in dygraph optimizers,test=develop (#17484)

上级 ca3ba378
...@@ -499,6 +499,9 @@ class Optimizer(object): ...@@ -499,6 +499,9 @@ class Optimizer(object):
optimize_ops = self.apply_optimize( optimize_ops = self.apply_optimize(
loss, startup_program=startup_program, params_grads=params_grads) loss, startup_program=startup_program, params_grads=params_grads)
if framework.in_dygraph_mode():
framework._dygraph_tracer()._clear_ops()
return optimize_ops, params_grads return optimize_ops, params_grads
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册