From 77fffc60c6de0ffce97c0610d293179e306e079f Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Mon, 25 Dec 2017 17:50:52 +0800 Subject: [PATCH] fix a bug --- python/paddle/v2/fluid/backward.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/paddle/v2/fluid/backward.py b/python/paddle/v2/fluid/backward.py index 382d057be..0e3c8762f 100644 --- a/python/paddle/v2/fluid/backward.py +++ b/python/paddle/v2/fluid/backward.py @@ -13,8 +13,11 @@ def _rename_arg_(op_desc_list, old_name, new_name, begin_idx=None, if end_idx is None: end_idx = len(op_desc_list) for i in range(begin_idx, end_idx): - op_desc_list[i].rename_input(old_name, new_name) - op_desc_list[i].rename_output(old_name, new_name) + op_desc = op_desc_list[i] + if isinstance(op_desc, tuple): + op_desc = op_desc[0] + op_desc.rename_input(old_name, new_name) + op_desc.rename_output(old_name, new_name) def _create_op_desc_(op_type, inputs, outputs, attrs): -- GitLab