docs: def _create_gate_variables(self, input_shape, dtype):
      """Initialize the variables used for the gates."""
      if len(input_shape) != 2:
        raise ValueError(
            "Rank of shape must be {} not: {}".format(2, len(input_shape)))
      input_size = input_shape.dims[1].value
  
      b_shape = [4 * self._hidden_size]
  
      equiv_input_size = self._hidden_size + input_size
      initializer = basic.create_linear_initializer(equiv_input_size)
  
      if self._use_batch_norm_h or self._use_batch_norm_x:
        self._w_h = tf.get_variable(
            self.W_GATES + "_H",
            shape=[self._hidden_size, 4 * self._hidden_size],
            dtype=dtype,
            initializer=self._initializers.get(self.W_GATES, initializer),
            partitioner=self._partitioners.get(self.W_GATES),
            regularizer=self._regularizers.get(self.W_GATES))
        self._w_x = tf.get_variable(
            self.W_GATES + "_X",
            shape=[input_size, 4 * self._hidden_size],
            dtype=dtype,
            initializer=self._initializers.get(self.W_GATES, initializer),
            partitioner=self._partitioners.get(self.W_GATES),
            regularizer=self._regularizers.get(self.W_GATES))
      else:
        self._w_xh = tf.get_variable(
            self.W_GATES,
            shape=[self._hidden_size + input_size, 4 * self._hidden_size],
            dtype=dtype,
            initializer=self._initializers.get(self.W_GATES, initializer),
            partitioner=self._partitioners.get(self.W_GATES),
            regularizer=self._regularizers.get(self.W_GATES))
      self._b = tf.get_variable(
          self.B_GATES,
          shape=b_shape,
          dtype=dtype,
          initializer=self._initializers.get(self.B_GATES, initializer),
          partitioner=self._partitioners.get(self.B_GATES),
          regularizer=self._regularizers.get(self.B_GATES))