提交 c241b19a 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!358 Fix optimizer.decay_weight bug

Merge pull request !358 from fanglei/master
......@@ -109,7 +109,7 @@ class Optimizer(Cell):
tuple[Tensor], The gradients after weight decay.
"""
if self.weight_decay > 0:
params = self.params
params = self.parameters
gradients = self.hyper_map(F.partial(apply_decay, self.weight_decay), self.decay_flags, params, gradients)
return gradients
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册