(self, input_signature)
Randomly initializes this layer's weights.
Randomly initializes this layer's weights.
Randomly initializes this layer s weights .
def init_weights_and_state(self, input_signature):
    """Randomly initializes this layer's weights."""
    shape_w = (self._kernel_size, input_signature.shape[-1])
    rng_w, _ = fastmath.random.split(self.rng, 2)
    w = self._kernel_initializer(shape_w, rng_w)
    if self._use_bfloat16:
      w = w.astype(jnp.bfloat16)
    self.weights = w
def init_weights_and_state ( self , input_signature ) : shape_w = ( self . _kernel_size , input_signature . shape [ - 1 ] ) rng_w , _ = fastmath . random . split ( self . rng , 2 ) w = self . _kernel_initializer ( shape_w , rng_w ) if self . _use_bfloat16 : w = w . astype ( jnp . bfloat16 ) self . weights = w