Exemplo n.º 1
0
    def __init__(self, trainable=True, name=None, **kwargs):
        """Initliazes a new Layer instance.

        Arguments:
          trainable: a boolean flag indicating if the variables created bytearray
            the layer should be considered as trainable.
        """
        self._trainable = trainable
        self._name = name or self.__class__.__name__
        self._scope = None
        self._reuse = False
        self._variables = []

        scope = kwargs.get('_scope')
        if scope is not None:
            self._scope = utils.as_scope(scope)
        reuse = kwargs.get('_reuse')
        if reuse:
            self._reuse = True
Exemplo n.º 2
0
 def _default_scope(self):
     """Returns the default scope."""
     return utils.as_scope(self._name)
Exemplo n.º 3
0
 def test_scope(self):
     """Test the default behaviour of a layer."""
     self._test_scope(None)
     self._test_scope('Scope')
     self._test_scope(utils.as_scope('Scope'))