From 03f418c5d1a4b2a1fc65867c3dec7306aaec706e Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Thu, 27 Jul 2017 10:38:26 +0800 Subject: [PATCH] Fix compile error --- paddle/framework/backward.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/paddle/framework/backward.cc b/paddle/framework/backward.cc index 1531cb53f9d..db4af8c7120 100644 --- a/paddle/framework/backward.cc +++ b/paddle/framework/backward.cc @@ -78,18 +78,16 @@ static std::shared_ptr BackwardImpl( std::string prefix = grad_input.substr( 0, grad_input.size() - OperatorBase::GRAD_VAR_SUFFIX().size()); grad_input = prefix + OperatorBase::ZERO_VAR_SUFFIX(); - std::vector fill_zeros_in = {prefix}; - std::vector fill_zeros_out = {grad_input}; - net.AddOp(OpRegistry::CreateOp("fill_zeros_like", fill_zeros_in, - fill_zeros_out, AttributeMap())); + net->AddOp(OpRegistry::CreateOp("fill_zeros_like", {prefix}, + {grad_input}, {})); } } - for (std::string& grad_output : grad_op->output_) { + for (std::string& grad_output : grad_op->outputs_) { if (no_grad_names.count(grad_output)) { grad_output = OperatorBase::EMPTY_VAR_NAME(); } } - net.AddOp(grad_op); + net->AddOp(grad_op); } net->CompleteAddOp(); -- GitLab