'Gated recurrent unit (GRU) with nunits cells.'

def __call__(self, inputs, state, scope=None):

    with tf.variable_scope((scope or type(self).__name__)):
        with tf.variable_scope('Gates'):
            _w = _linear([inputs, state], (2 * self._num_units), True, 1.0, self.weights_init, self.trainable, self.restore, self.reuse)
            (r, u) = array_ops.split(value=_w, num_or_size_splits=2, axis=1)
            (r, u) = (self._inner_activation(r), self._inner_activation(u))
        with tf.variable_scope('Candidate'):
            c = self._activation(_linear([inputs, (r * state)], self._num_units, True, 0.0, self.weights_init, self.trainable, self.restore, self.reuse))
        new_h = ((u * state) + ((1 - u) * c))
        (self.W, self.b) = (list(), list())
        with tf.variable_scope('Gates/Linear', reuse=True):
            self.W.append(tf.get_variable('Matrix'))
            self.b.append(tf.get_variable('Bias'))
        with tf.variable_scope('Candidate/Linear', reuse=True):
            self.W.append(tf.get_variable('Matrix'))
            self.b.append(tf.get_variable('Bias'))
    return (new_h, new_h)
