提交 c4d0bb26 编写于 作者: L leilei_snow

fix optimizer.decay_weight bug

上级 6721541c
...@@ -109,7 +109,7 @@ class Optimizer(Cell): ...@@ -109,7 +109,7 @@ class Optimizer(Cell):
tuple[Tensor], The gradients after weight decay. tuple[Tensor], The gradients after weight decay.
""" """
if self.weight_decay > 0: 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) gradients = self.hyper_map(F.partial(apply_decay, self.weight_decay), self.decay_flags, params, gradients)
return gradients return gradients
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册