diff --git a/python/paddle/fluid/optimizer.py b/python/paddle/fluid/optimizer.py index 625fcf78b340217116a81af3fd3abd762cb39c95..c3b7aee2b4d2421927adeb9fd44a516a7999cf83 100644 --- a/python/paddle/fluid/optimizer.py +++ b/python/paddle/fluid/optimizer.py @@ -275,7 +275,7 @@ class Optimizer(object): self._create_global_learning_rate() optimize_ops = [] - if framework._in_dygraph_mode(): + if framework.in_dygraph_mode(): for param_and_grad in parameters_and_grads: if param_and_grad[1] is None: continue