class_docstr: Represents a Node in a tree containing a layer.
  
  `LayerNode` is used to represent a tree of layers in a model. It contains
  config which describes the layer, and other input layers feeding into it.
  
  It is used as a generic class to represent both sets of layers which have
  been found in a model, and layers which should be replaced inside the model.
docstr: Construct a LayerNode representing a tree of layers.
  
  Args:
    layer: layer config of this node.
    weights: An OrderedDict of weight name => value for the layer.
    input_layers: List of `LayerNode`s that feed into this layer.
    metadata: Dictionary of metadata for a given layer.
    names_and_weights: A list of tuples (name, weight). It only used when
      weights dictionary is empty.
docstr_tok: ["Construct","a","LayerNode","representing","a","tree","of","layers",".","Args",":","layer",":","layer","config","of","this","node",".","weights",":","An","OrderedDict","of","weight","name","=",">","value","for","the","layer",".","input_layers",":","List","of","`","LayerNode","`","s","that","feed","into","this","layer",".","metadata",":","Dictionary","of","metadata","for","a","given","layer",".","names_and_weights",":","A","list","of","tuples","(","name",",","weight",")",".","It","only","used","when","weights","dictionary","is","empty","."]
code: def __init__(
      self,
      layer,
      weights=None,
      input_layers=None,
      metadata=None,
      names_and_weights=None,
  ):
      """Construct a LayerNode representing a tree of layers.
  
      Args:
        layer: layer config of this node.
        weights: An OrderedDict of weight name => value for the layer.
        input_layers: List of `LayerNode`s that feed into this layer.
        metadata: Dictionary of metadata for a given layer.
        names_and_weights: A list of tuples (name, weight). It only used when
          weights dictionary is empty.
      """
      if weights is None:
          weights = collections.OrderedDict()
      if input_layers is None:
          input_layers = []
      if metadata is None:
          metadata = {}
      if names_and_weights is None:
          names_and_weights = []
  
      self.layer = layer
      self.weights = weights
      self.input_layers = input_layers
      self.metadata = metadata
      self.names_and_weights = names_and_weights
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import collections
  import six
label_desc: Use image node_id 1 to create a new LayerNode object from inherited base classes: object with example: obj = LayerNode(layer, weights, input_layers, metadata, names_and_weights)