diff --git a/paddle/fluid/imperative/variable_wrapper.h b/paddle/fluid/imperative/variable_wrapper.h index 5922bfcdb9fbb99b993b532de7f012afd9edf019..d8373042078502b0faf7f87c0b826bd691cf36a0 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;