From a240bce1529df0ad227cdc8eddd918630fcf26dc Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Mon, 14 Aug 2017 19:46:19 +0800 Subject: [PATCH] fix backward --- paddle/framework/backward.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/framework/backward.cc b/paddle/framework/backward.cc index 1fddad8d16f..ab91e422eea 100644 --- a/paddle/framework/backward.cc +++ b/paddle/framework/backward.cc @@ -79,9 +79,9 @@ std::shared_ptr BackwardRecursive( // All output gradients of forwarding operator do not need to calculate. // Then all input gradients cannot be computed at all, and we put them into // `no_grad_names` set. Return an NOP. - if (AllInSet(forwardOp.Output() /*names*/, kGradVarSuffix /*suffix*/, + if (AllInSet(forwardOp.Outputs() /*names*/, kGradVarSuffix /*suffix*/, no_grad_names /*set*/)) { - ForEachVarName(forwardOp.inputs_, + ForEachVarName(forwardOp.Inputs(), [&no_grad_names](const std::string& name) -> bool { no_grad_names.insert(GradVarName(name)); return false; -- GitLab