Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbo9674 committed Dec 22, 2021
1 parent 151c2ef commit 6416a0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/paddle/optimizer/momentum.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def __init__(self,

def _update_regularization(self, weight_decay):
reg_method = ""
reg_coeff = 0
reg_coeff = 0.0

if (isinstance(weight_decay, L2DecayRegularizer)):
reg_method = "l2_decay"
Expand Down Expand Up @@ -306,7 +306,7 @@ def _append_optimize_op(self, block, param_and_grad):
# the param's regularization has been done before, we avoid do l2decay in momentum.
elif param.regularizer is not None:
regularization_method = ""
regularization_coeff = 0
regularization_coeff = 0.0

find_master = self._multi_precision and param_and_grad[
0].dtype == core.VarDesc.VarType.FP16
Expand Down

1 comment on commit 6416a0e

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.