From 7e4b96735d5b3a9d33bf131ef1611ca36281e71a Mon Sep 17 00:00:00 2001 From: sandyhouse Date: Fri, 28 Aug 2020 08:27:44 +0000 Subject: [PATCH] add op_role_key, test=develop --- python/paddle/fluid/optimizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/fluid/optimizer.py b/python/paddle/fluid/optimizer.py index a41f23e2dde..3891952d5b9 100644 --- a/python/paddle/fluid/optimizer.py +++ b/python/paddle/fluid/optimizer.py @@ -4173,6 +4173,7 @@ class PipelineOptimizer(object): 'dtype': grad_var.dtype, 'value': float(0), self._op_device_key: device, + self._op_role_key: self._op_role.Optimize.LRSched, }) def _accumulate_gradients(self, block): @@ -4374,7 +4375,6 @@ class PipelineOptimizer(object): # and clear them after update self._clear_gradients(main_block) self._accumulate_gradients(main_block) - #self._clear_gradients(main_block) main_program = main_block.program -- GitLab