From 57f57ead32e8f0fe4b89c094ae17fb2926336047 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Thu, 3 Aug 2017 14:58:39 +0800 Subject: [PATCH] Add @EMPTY@ to default no_grad_vars in `Backward` --- paddle/framework/backward.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/framework/backward.cc b/paddle/framework/backward.cc index 0da11b91a7f..e784bb2b7d7 100644 --- a/paddle/framework/backward.cc +++ b/paddle/framework/backward.cc @@ -168,6 +168,9 @@ std::shared_ptr Backward( std::unordered_set no_grad_names; no_grad_names.reserve(no_grad_vars.size()); + no_grad_names.insert(OperatorBase::EMPTY_VAR_NAME() + + OperatorBase::GRAD_VAR_SUFFIX()); + for (auto& name : no_grad_vars) { no_grad_names.insert(name + OperatorBase::GRAD_VAR_SUFFIX()); } -- GitLab