class_docstr: Builds a traditional GRU cell with dense internal transformations.
  
  Gated Recurrent Unit paper: https://arxiv.org/abs/1412.3555
class_docstr_tok: ["Builds","a","traditional","GRU","cell","with","dense","internal","transformations",".","Gated","Recurrent","Unit","paper",":","https",":","\/\/arxiv.org\/abs\/1412.3555"]
code: def init_weights_and_state(self, input_signature):
      if input_signature[1].shape[-1] != self._n_units:
          raise ValueError(
              f"Second argument in input signature should have a final dimension of"
              f" {self._n_units}; instead got {input_signature[1].shape[-1]}."
          )
  
      # The dense layer input is the input and half of the GRU state.
      input_shape = input_signature[0].shape[-1] + self._n_units
      rng1, rng2, rng3, rng4 = fastmath.random.split(self.rng, 4)
      w1 = self._kernel_initializer(
          (input_shape, 2 * self._n_units), rng1
      )
      b1 = (
          self._bias_initializer((2 * self._n_units,), rng2)
          + self._forget_bias
      )
      w2 = self._kernel_initializer((input_shape, self._n_units), rng3)
      b2 = self._bias_initializer((self._n_units,), rng4)
      self.weights = (w1, b1, w2, b2)
  
imports: from trax import fastmath
  from trax.fastmath import numpy
  from trax.layers import activation_fns
  from trax.layers import base
  from trax.layers import combinators
  from trax.layers import convolution
  from trax.layers import core
  from trax.layers import initializers
label_desc: Use image node_id 3 for calling the GRUCell obj's underlying member method code with example usage: obj.init_weights_and_state(input_signature) without return types