Skip to content

Commit 6416a0e

Browse files
committed
fix bug
1 parent 151c2ef commit 6416a0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/paddle/optimizer/momentum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def __init__(self,
192192

193193
def _update_regularization(self, weight_decay):
194194
reg_method = ""
195-
reg_coeff = 0
195+
reg_coeff = 0.0
196196

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

311311
find_master = self._multi_precision and param_and_grad[
312312
0].dtype == core.VarDesc.VarType.FP16

0 commit comments

Comments
 (0)