From 492d43ef96ef810601c02373122b19adffe2b515 Mon Sep 17 00:00:00 2001 From: Zhou Wei <52485244+zhouwei25@users.noreply.github.com> Date: Mon, 7 Dec 2020 20:58:45 +0800 Subject: [PATCH] fix that parameters'grad has grad var (#29440) --- 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 5922bfcdb9f..d8373042078 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