def rms_prop_step(p, lr, sqr_avg, eps, grad_avg=None, **kwargs):
    """Step for SGD with momentum with `lr`"""
    denom = sqr_avg.sqrt().add_(eps)
    p.data.addcdiv_(grad_avg if grad_avg is not None else p.grad, denom,
        value=-lr)
