class_docstr: The basic :class:`Layer` class represents a single layer of a neural network.
  
  It should be subclassed when implementing new types of layers.
  
  Parameters
  ----------
  name : str or None
      A unique layer name. If None, a unique name will be automatically assigned.
  
  Methods
  ---------
  __init__()
      Initializing the Layer.
  __call__()
      (1) Building the Layer if necessary. (2) Forwarding the computation.
  all_weights()
      Return a list of Tensor which are all weights of this Layer.
  trainable_weights()
      Return a list of Tensor which are all trainable weights of this Layer.
  nontrainable_weights()
      Return a list of Tensor which are all nontrainable weights of this Layer.
  build()
      Abstract method. Build the Layer. All trainable weights should be defined in this function.
  forward()
      Abstract method. Forward computation and return computation results.
class_docstr_tok: ["The","basic",":","class",":","`","Layer","`","class","represents","a","single","layer","of","a","neural","network",".","It","should","be","subclassed","when","implementing","new","types","of","layers",".","Parameters","--","--","--","--","--","name",":","str","or","None","A","unique","layer","name",".","If","None",",","a","unique","name","will","be","automatically","assigned",".","Methods","--","--","--","--","-","__init__","(",")","Initializing","the","Layer",".","__call__","(",")","(","1",")","Building","the","Layer","if","necessary",".","(","2",")","Forwarding","the","computation",".","all_weights","(",")","Return","a","list","of","Tensor","which","are","all","weights","of","this","Layer",".","trainable_weights","(",")","Return","a","list","of","Tensor","which","are","all","trainable","weights","of","this","Layer",".","nontrainable_weights","(",")","Return","a","list","of","Tensor","which","are","all","nontrainable","weights","of","this","Layer",".","build","(",")","Abstract","method",".","Build","the","Layer",".","All","trainable","weights","should","be","defined","in","this","function",".","forward","(",")","Abstract","method",".","Forward","computation","and","return","computation","results","."]
docstr: Initializing the Layer.
  
  :param name: str or None
  :param name: str or function or None
code: def __init__(self, name=None, act=None, *args, **kwargs):
      """
      Initializing the Layer.
  
      :param name: str or None
      :param name: str or function or None
      """
  
      # Layer constants
      # for key in kwargs.keys():
      #     setattr(self, key, self._argument_dict_checkup(kwargs[key]))
  
      # Auto naming if the name is not given
      global _global_layer_name_dict
      if name is None:
          prefix = self.__class__.__name__.lower()
  
          if _global_layer_name_dict.get(prefix) is not None:
              _global_layer_name_dict[prefix] += 1
              name = prefix + "_" + str(_global_layer_name_dict[prefix])
          else:
              _global_layer_name_dict[prefix] = 0
              name = prefix
          while True:
              if _global_layer_name_dict.get(name) is None:
                  break
              _global_layer_name_dict[prefix] += 1
              name = prefix + "_" + str(_global_layer_name_dict[prefix])
      else:
          if _global_layer_name_dict.get(name) is not None:
              pass
              # raise ValueError(
              #     'Layer name \'%s\' has already been used by another layer. Please change the layer name.' % name
              # )
          else:
              _global_layer_name_dict[name] = 0
  
      self.name = name
      if isinstance(act, str):
          self.act = str2act(act)
      else:
          self.act = act
  
      # Layer building state
      self._built = False
  
      # Layer nodes state
      self._nodes = []
      self._nodes_fixed = False
  
      # Layer weight state
      self._all_weights = None
      self._trainable_weights = []
      self._nontrainable_weights = []
  
      # nested layers
      self._layers = None
  
      # Layer training state
      self.is_train = True
  
      # layer config and init_args
      self._config = None
      self.layer_args = self._get_init_args(skip=3)
  
imports: import inspect
  from abc import abstractmethod
  import tensorflow
  import tensorlayer
  from tensorlayer import logging
  from tensorlayer.decorators import deprecated_alias, private_method, protected_method
  from tensorlayer.files import utils
  from tensorlayer.layers.utils import get_variable_with_initializer, list_remove_repeat
label_desc: Use image node_id 1 to create a new Layer object from inherited base classes: object with example: obj = Layer(name, act)