class_docstr: Base layer class.
  
  It is considered legacy, and we recommend the use of `tf.keras.layers.Layer`
  instead.
  
  Args:
    trainable: Boolean, whether the layer's variables should be trainable.
    name: String name of the layer.
    dtype: Default dtype of the layer's weights (default of `None` means use the
      type of the first input).
  
  Read-only properties:
    name: The name of the layer (string).
    dtype: Default dtype of the layer's weights (default of `None` means use the
      type of the first input).
    trainable_variables: List of trainable variables.
    non_trainable_variables: List of non-trainable variables.
    variables: List of all variables of this layer, trainable and
      non-trainable.
    updates: List of update ops of this layer.
    losses: List of losses added by this layer.
    trainable_weights: List of variables to be included in backprop.
    non_trainable_weights: List of variables that should not be
      included in backprop.
    weights: The concatenation of the lists trainable_weights and
      non_trainable_weights (in this order).
  
  Mutable properties:
    trainable: Whether the layer should be trained (boolean).
    input_spec: Optional (list of) `InputSpec` object(s) specifying the
      constraints on inputs that can be accepted by the layer.
class_docstr_tok: ["Base","layer","class",".","It","is","considered","legacy",",","and","we","recommend","the","use","of","`","tf.keras.layers.Layer","`","instead",".","Args",":","trainable",":","Boolean",",","whether","the","layer","'s","variables","should","be","trainable",".","name",":","String","name","of","the","layer",".","dtype",":","Default","dtype","of","the","layer","'s","weights","(","default","of","`","None","`","means","use","the","type","of","the","first","input",")",".","Read-only","properties",":","name",":","The","name","of","the","layer","(","string",")",".","dtype",":","Default","dtype","of","the","layer","'s","weights","(","default","of","`","None","`","means","use","the","type","of","the","first","input",")",".","trainable_variables",":","List","of","trainable","variables",".","non_trainable_variables",":","List","of","non-trainable","variables",".","variables",":","List","of","all","variables","of","this","layer",",","trainable","and","non-trainable",".","updates",":","List","of","update","ops","of","this","layer",".","losses",":","List","of","losses","added","by","this","layer",".","trainable_weights",":","List","of","variables","to","be","included","in","backprop",".","non_trainable_weights",":","List","of","variables","that","should","not","be","included","in","backprop",".","weights",":","The","concatenation","of","the","lists","trainable_weights","and","non_trainable_weights","(","in","this","order",")",".","Mutable","properties",":","trainable",":","Whether","the","layer","should","be","trained","(","boolean",")",".","input_spec",":","Optional","(","list","of",")","`","InputSpec","`","object","(","s",")","specifying","the","constraints","on","inputs","that","can","be","accepted","by","the","layer","."]
code: def __init__(self, trainable=True, name=None, dtype=None, **kwargs):
      # For backwards compatibility, legacy layers do not use `ResourceVariable`
      # by default.
      self._use_resource_variables = False
      scope = kwargs.pop("_scope", None)
      self._reuse = kwargs.pop("_reuse", None)
  
      # Avoid an incorrect lint error
      self._trainable_weights = []
      self.built = False
  
      if dtype is None:
          # Indicates to infer dtype from inputs. When the V2 dtype behavior is
          # enabled, Keras layers default their dtype to floatx instead, so we pass
          # an "_infer" policy to keep the old V1 behavior.
          dtype = policy.Policy("_infer")
  
      if "autocast" not in kwargs:
          kwargs["autocast"] = False
  
      # Mark that legacy layers should not be instrumented as Keras usage
      self._disable_keras_instrumentation = True
  
      super(Layer, self).__init__(
          trainable=trainable, name=name, dtype=dtype, **kwargs
      )
  
      if _is_in_keras_style_scope():
          if scope is not None:
              raise ValueError(
                  "scope argument not allowed when keras style layers are enabled, "
                  "but saw: {}".format(scope)
              )
          if self._reuse is not None:
              raise ValueError(
                  "reuse argument not allowed when keras style layers are enabled, "
                  "but saw: {}".format(self._reuse)
              )
          self._keras_style = True
      else:
          self._keras_style = False
  
      self._call_has_scope_arg = "scope" in self._call_fn_args
      if scope:
          with vs.variable_scope(scope) as captured_scope:
              self._scope = captured_scope
      else:
          self._scope = None
      self._current_scope = None
  
imports: import copy
  import warnings
  from tensorflow.python.eager import context
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.keras import backend
  from tensorflow.python.keras.engine import base_layer
  from tensorflow.python.keras.engine import base_layer_utils
  from tensorflow.python.keras.legacy_tf_layers import variable_scope_shim
  from tensorflow.python.keras.mixed_precision import policy
  from tensorflow.python.keras.utils import tf_contextlib
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variables
  from tensorflow.python.trackable import base
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 to create a new Layer object from inherited base classes: base_layer with example: obj = Layer(trainable, name, dtype)