diff --git a/python/paddle/fluid/optimizer.py b/python/paddle/fluid/optimizer.py index efdd55d856f3988de801acc951f6dba75c752063..228ba08499808f237bb006515d0054b32476da15 100755 --- a/python/paddle/fluid/optimizer.py +++ b/python/paddle/fluid/optimizer.py @@ -2086,7 +2086,7 @@ class LarsMomentumOptimizer(Optimizer): # create the momentum optimize op momentum_op = block.append_op( - type=self.type, + type=self.type if _lars_weight_decay != 0.0 else 'momentum', inputs=inputs, outputs=outputs, attrs=attrs,