diff --git a/paddle/framework/backward.cc b/paddle/framework/backward.cc index 315bdde76d3ffe57b656aa69688def6d274f592c..855e2cae20cc47387cd7dde1ec74347824fbe82d 100644 --- a/paddle/framework/backward.cc +++ b/paddle/framework/backward.cc @@ -127,11 +127,8 @@ std::shared_ptr BackwardRecursive( net->ops_[op_offset]->Rename(name, dup_outputs.back()); } insert_position.push_back( - {dup_op.back(), - OpRegistry::CreateOp( - "add", {{"X", {dup_outputs}}}, {{"Out", {name}}}, - {{"input_format", - std::vector{0, static_cast(dup_outputs.size())}}})}); + {dup_op.back(), OpRegistry::CreateOp("add", {{"X", {dup_outputs}}}, + {{"Out", {name}}}, {})}); } insert_position.sort( @@ -140,7 +137,6 @@ std::shared_ptr BackwardRecursive( for (auto& pos : insert_position) { net->InsertOp(pos.first + 1, pos.second); } - } else { std::shared_ptr grad_op = OpRegistry::CreateGradOp(forwardOp); @@ -176,7 +172,7 @@ std::shared_ptr BackwardRecursive( net->type_ = "@GENERATED_BACKWARD@"; net->CompleteAddOp(); return net; -} +} // namespace framework // See header for comments std::shared_ptr Backward(