def METHOD_NAME(self, gradients):
    lr = self.get_lr()
    gradients = scale_grad(gradients, self.reciprocal_scale)
    if self.clip:
        gradients = ops.clip_by_global_norm(gradients, 5.0, None)
    beta1_power = self.beta1_power * self.beta1
    self.beta1_power = beta1_power
    beta2_power = self.beta2_power * self.beta2
    self.beta2_power = beta2_power
    if self.is_group:
        if self.is_group_lr:
            optim_result = self.hyper_map(
                ops.partial(_adam_opt, beta1_power, beta2_power, self.beta1, self.beta2, self.eps),
                lr,
                self.weight_decay,
                self.parameters,
                self.moments1,
                self.moments2,
                gradients,
                self.decay_flags,
                self.optim_filter,
            )
        else:
            optim_result = self.hyper_map(
                ops.partial(_adam_opt, beta1_power, beta2_power, self.beta1, self.beta2, self.eps, lr),
                self.weight_decay,
                self.parameters,
                self.moments1,
                self.moments2,
                gradients,
                self.decay_flags,
                self.optim_filter,
            )
    else:
        optim_result = self.hyper_map(
            ops.partial(
                _adam_opt, beta1_power, beta2_power, self.beta1, self.beta2, self.eps, lr, self.weight_decay
            ),
            self.parameters,
            self.moments1,
            self.moments2,
            gradients,
            self.decay_flags,
            self.optim_filter,
        )
    if self.use_parallel:
        self.broadcast_params(optim_result)
    return optim_result