!358 Fix optimizer.decay_weight bug

Merge pull request !358 from fanglei/master
This commit is contained in:
mindspore-ci-bot 2020-04-15 18:48:57 +08:00 committed by Gitee
commit c241b19a53
1 changed files with 1 additions and 1 deletions

View File

@ -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