(self, input_signature)
Randomly initializes this layer's weights.

    Weights are a `(w, b)` tuple for layers created with `use_bias=True` (the
    default case), or a `w` tensor for layers created with `use_bias=False`.

    Args:
      input_signature: `ShapeDtype` instance characterizing the input this layer
          should compute on.
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.

    Weights are a `(w, b)` tuple for layers created with `use_bias=True` (the
    default case), or a `w` tensor for layers created with `use_bias=False`.

    Args:
      input_signature: `ShapeDtype` instance characterizing the input this layer
          should compute on.
    """
    shape_w = (input_signature.shape[-2], self._kernel_size,
               input_signature.shape[-1], self._filters)
    if self._padding == 'VALID':
      shape_b = (input_signature.shape[-2] - self._kernel_size + 1,
                 self._filters,)
    else:
      shape_b = (input_signature.shape[-2], self._filters,)

    rng_w, rng_b = fastmath.random.split(self.rng, 2)
    w = self._kernel_initializer(shape_w, rng_w, nonreceptive_dims=[0])

    if self._use_bias:
      b = self._bias_initializer(shape_b, rng_b)
      self.weights = (w, b)
    else:
      self.weights = w
def init_weights_and_state ( self , input_signature ) : shape_w = ( input_signature . shape [ - 2 ] , self . _kernel_size , input_signature . shape [ - 1 ] , self . _filters ) if self . _padding == 'VALID' : shape_b = ( input_signature . shape [ - 2 ] - self . _kernel_size + 1 , self . _filters , ) else : shape_b = ( input_signature . shape [ - 2 ] , self . _filters , ) rng_w , rng_b = fastmath . random . split ( self . rng , 2 ) w = self . _kernel_initializer ( shape_w , rng_w , nonreceptive_dims = [ 0 ] ) if self . _use_bias : b = self . _bias_initializer ( shape_b , rng_b ) self . weights = ( w , b ) else : self . weights = w