diff --git a/python/paddle/fluid/optimizer.py b/python/paddle/fluid/optimizer.py index 21b4c429a66e9d87742a7873a2d737a9f15823bf..41d540107454821ea2e3f20ae2ffcf5d81295991 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: