From d19b5da08e460cccdf952e10d3a2235c8ef41987 Mon Sep 17 00:00:00 2001 From: lilong12 Date: Wed, 5 May 2021 12:54:07 +0800 Subject: [PATCH] bug fix, test=develop (#32730) --- python/paddle/fluid/optimizer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/optimizer.py b/python/paddle/fluid/optimizer.py index 21b4c429a66..41d54010745 100755 --- a/python/paddle/fluid/optimizer.py +++ b/python/paddle/fluid/optimizer.py @@ -4592,13 +4592,13 @@ class PipelineOptimizer(object): origin_sub_block_id = op.attr('sub_block').id origin_sub_block = main_program.block(origin_sub_block_id) new_sub_block = prog._create_block(parent_idx=0) - for op in origin_sub_block.ops: - op_desc = op.desc + for sub_op in origin_sub_block.ops: + op_desc = sub_op.desc ap_op = new_sub_block.desc.append_op() ap_op.copy_from(op_desc) new_sub_block._sync_with_cpp() self._create_vars(new_sub_block, origin_sub_block) - op._set_attr('sub_block:', new_sub_block) + op._set_attr('sub_block', new_sub_block) def _get_device_info(self, block): for op in block.ops: -- GitLab