import tensorflow as tf

        v = self.get_slot(var, "v")
        v_t = v.assign(beta2_t * v + (1. - beta2_t) * tf.square(grad))
        m = self.get_slot(var, "m")
        m_t = m.assign(beta1_t * m + (1. - beta1_t) * grad)
        v_t_hat = tf.div(v_t, 1. - beta2_t)
        m_t_hat = tf.div(m_t, 1. - beta1_t)

        g_t = tf.div(m_t_hat, tf.sqrt(v_t_hat) + eps)
        g_t_1 = self.get_slot(var, "g")
        g_t = g_t_1.assign(g_t)
