(self, n_in=1, n_out=1, name=None, sublayers_to_print=None)
Creates a partially initialized, unconnected layer instance.

    Args:
      n_in: Number of inputs expected by this layer.
      n_out: Number of outputs promised by this layer.
      name: Class-like name for this layer; for use when printing this layer.
      sublayers_to_print: Sublayers to display when printing out this layer;
        if None (the default), display all sublayers.
Creates a partially initialized, unconnected layer instance.
Creates a partially initialized unconnected layer instance .
def __init__(self, n_in=1, n_out=1, name=None, sublayers_to_print=None):
    """Creates a partially initialized, unconnected layer instance.

    Args:
      n_in: Number of inputs expected by this layer.
      n_out: Number of outputs promised by this layer.
      name: Class-like name for this layer; for use when printing this layer.
      sublayers_to_print: Sublayers to display when printing out this layer;
        if None (the default), display all sublayers.
    """
    self._n_in = n_in
    self._n_out = n_out
    self._name = self.__class__.__name__ if name is None else name
    self._sublayers_to_print = sublayers_to_print
    self._sublayers = ()  # Default is no sublayers.

    # The actual rng value/shape depends on the backend, which may not yet be
    # initialized at the point this method is run. Hence, at first initialize
    # only a seed random integer, in a backend-neutral way.
    self._rng = None
    self._rng_seed_int = random.randint(0, 2**31 - 1)

    # The private fields _weights and _state store the private part of
    # layer weights and state. When a layer has no sublayers, these are
    # the same as layer.weights and layer.state. For layers with sublayers
    # (i.e., combinators), these just mark which weights are cached -- see
    # the getter and setter for weights and state for details.
    # There is no need to use these fields in most user-implemented classes.
    self._weights = EMPTY_WEIGHTS  # By default no trainable weights.
    self._state = EMPTY_STATE  # By default no non-trainable state.

    # Record layer creation site for use in LayerError messages.
    # The frame can mutate, so copy relevant values out of it.
    frame = _find_frame(inspect.currentframe())
    self._caller = {'filename': copy.copy(frame.f_code.co_filename),
                    'lineno': int(frame.f_lineno)}
    del frame  # Just in case.

    self._init_cached = False
    self._jit_cache = {}
def __init__ ( self , n_in = 1 , n_out = 1 , name = None , sublayers_to_print = None ) : self . _n_in = n_in self . _n_out = n_out self . _name = self . __class__ . __name__ if name is None else name self . _sublayers_to_print = sublayers_to_print self . _sublayers = ( ) # Default is no sublayers. # The actual rng value/shape depends on the backend, which may not yet be # initialized at the point this method is run. Hence, at first initialize # only a seed random integer, in a backend-neutral way. self . _rng = None self . _rng_seed_int = random . randint ( 0 , 2 ** 31 - 1 ) # The private fields _weights and _state store the private part of # layer weights and state. When a layer has no sublayers, these are # the same as layer.weights and layer.state. For layers with sublayers # (i.e., combinators), these just mark which weights are cached -- see # the getter and setter for weights and state for details. # There is no need to use these fields in most user-implemented classes. self . _weights = EMPTY_WEIGHTS # By default no trainable weights. self . _state = EMPTY_STATE # By default no non-trainable state. # Record layer creation site for use in LayerError messages. # The frame can mutate, so copy relevant values out of it. frame = _find_frame ( inspect . currentframe ( ) ) self . _caller = { 'filename' : copy . copy ( frame . f_code . co_filename ) , 'lineno' : int ( frame . f_lineno ) } del frame # Just in case. self . _init_cached = False self . _jit_cache = { }