(self, input_signature)
Initializes this layer's weights.
Initializes this layer's weights.
Initializes this layer s weights .
def init_weights_and_state(self, input_signature):
    """Initializes this layer's weights."""
    if isinstance(input_signature, (list, tuple)):
      input_signature = input_signature[0]
    self.weights = ()
    if self._mode == 'predict':
      shape = list(input_signature.shape)
      shape[1] = self._n_items_to_remember
      self.state = (jnp.zeros(shape, dtype=jnp.float32), {'init': ()})
    else:
      self.state = ()
def init_weights_and_state ( self , input_signature ) : if isinstance ( input_signature , ( list , tuple ) ) : input_signature = input_signature [ 0 ] self . weights = ( ) if self . _mode == 'predict' : shape = list ( input_signature . shape ) shape [ 1 ] = self . _n_items_to_remember self . state = ( jnp . zeros ( shape , dtype = jnp . float32 ) , { 'init' : ( ) } ) else : self . state = ( )