def METHOD_NAME(
    beta1,
    beta2,
    beta3,
    eps,
    lr,
    weight_decay,
    param,
    m,
    v,
    n,
    gradient,
    prev_gradient,
):
    """
    Update parameters.
    Args:
        beta1 (Tensor): The exponential decay rate for the 1st moment estimations. Should be in range (0.0, 1.0).
        beta2 (Tensor): The exponential decay rate for the 2nd moment estimations. Should be in range (0.0, 1.0).
        eps (Tensor): Term added to the denominator to improve numerical stability. Should be greater than 0.
        lr (Tensor): Learning rate.
        weight_decay (numbers.Number): Weight decay. Should be equal to or greater than 0. if 0, no decay
        param (Tensor): Parameters.
        m (Tensor): m value of parameters.
        v (Tensor): v value of parameters.
        gradient (Tensor): Gradient of parameters.
    Returns:
        Tensor, the new value of v after updating.
    """
    op_mul = ops.Mul()
    op_square = ops.Square()
    op_sqrt = ops.Sqrt()
    op_cast = ops.Cast()
    op_reshape = ops.Reshape()
    op_shape = ops.Shape()
    success = ms.Tensor(True, dtype=ms.bool_)
    if ops.reduce_sum(prev_gradient) == 0.0:
        success = ops.depend(success, ops.assign(prev_gradient, gradient))
    param_fp32 = op_cast(param, mstype.float32)
    m_fp32 = op_cast(m, mstype.float32)
    v_fp32 = op_cast(v, mstype.float32)
    n_fp32 = op_cast(n, mstype.float32)
    gradient_fp32 = op_cast(gradient, mstype.float32)
    prev_gradient_fp32 = op_cast(prev_gradient, mstype.float32)
    next_m = op_mul(ops.tuple_to_array((1.0,)) - beta1, m_fp32) + op_mul(beta1, gradient_fp32)
    next_v = op_mul(ops.tuple_to_array((1.0,)) - beta2, v_fp32) + op_mul(beta2, gradient_fp32 - prev_gradient_fp32)
    next_n = op_mul(ops.tuple_to_array((1.0,)) - beta3, n_fp32) + op_mul(
        beta3, op_square(gradient + op_mul(ops.tuple_to_array((1.0,)) - beta2, gradient_fp32 - prev_gradient_fp32))
    )
    lr_t = lr / (eps + op_sqrt(next_n))
    update = next_m + op_mul(ops.tuple_to_array((1.0,)) - beta2, next_v)
    next_param = param_fp32 - op_reshape(op_mul(lr_t, update), op_shape(param_fp32))
    next_param = next_param / (Tensor(1.0, mstype.float32) + op_mul(weight_decay, lr_t))
    success = ops.depend(success, ops.assign(param, op_cast(next_param, ops.dtype(param))))
    success = ops.depend(success, ops.assign(m, op_cast(next_m, ops.dtype(m))))
    success = ops.depend(success, ops.assign(v, op_cast(next_v, ops.dtype(v))))
    success = ops.depend(success, ops.assign(n, op_cast(next_n, ops.dtype(n))))
    success = ops.depend(success, ops.assign(prev_gradient, gradient))
    return op_cast(next_param, ops.dtype(param))