docs: def _ln_rnn(x, gamma, beta):
      r"""Applies layer normalization.
      Normalizes the last dimension of the tensor `x`.
      
      Args:
        x: A `Tensor`.
        gamma: A constant `Tensor`. Scale parameter. Default is 1.
        beta: A constant `Tensor`. Offset parameter. Default is 0.
  
      Returns:
        A `Tensor` with the same shape as `x`.
      """
      # calc layer mean, variance for final axis
      mean, variance = tf.nn.moments(x, axes=[len(x.get_shape()) - 1], keep_dims=True)
  
      # apply layer normalization
      x = (x - mean) / tf.sqrt(variance + tf.sg_eps)
  
      # apply parameter
      return gamma * x + beta