From 24ba9ed43691e91608d40a9fe572ee20d0d97825 Mon Sep 17 00:00:00 2001 From: Zhou Wei <52485244+zhouwei25@users.noreply.github.com> Date: Mon, 7 Dec 2020 19:28:59 +0800 Subject: [PATCH] fix that parameters'grad has grad var (#29408) --- paddle/fluid/imperative/variable_wrapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/imperative/variable_wrapper.h b/paddle/fluid/imperative/variable_wrapper.h index 5922bfcdb9..d837304207 100644 --- a/paddle/fluid/imperative/variable_wrapper.h +++ b/paddle/fluid/imperative/variable_wrapper.h @@ -81,7 +81,7 @@ class VariableWrapper { } bool IsLeafGrad() const { - if (!HasGradVar() && !HasGradNode() && !OverridedStopGradient()) { + if (!HasGradNode() && !OverridedStopGradient()) { return true; } return false; -- GitLab