class_docstr: Defines a transform to be applied to a keras model graph.
  
  A transform is a combination of 'Find + Replace' which describes how to find
  a pattern of layers in a model, and what to replace those layers with.
  
  A pattern is described using `LayerPattern`. The replacement function receives
  a `LayerNode` which contains the matched layers and should return a
  `LayerNode` which contains the set of layers which replaced the matched
  layers.
docstr: Generate a replacement sub-graph for the matched sub-graph.
  
  The fundamental constraint of the replacement is that the replacement
  sub-graph should consume the same input tensors as the original sub-graph
  and also produce a final list of tensors which are same in number and shape
  as the original sub-graph. Not following this could crash model creation,
  or introduce bugs in the new model graph.
  
  TODO(pulkitb): Consider adding list of input layers feeding into the
  sub-graph, and output layers feeding from the tip of the tree as parameters.
  These would be needed for complex replace cases.
  
  Args:
    match_layer: Matched sub-graph based on `self.pattern()`.
docstr_tok: ["Generate","a","replacement","sub-graph","for","the","matched","sub-graph",".","The","fundamental","constraint","of","the","replacement","is","that","the","replacement","sub-graph","should","consume","the","same","input","tensors","as","the","original","sub-graph","and","also","produce","a","final","list","of","tensors","which","are","same","in","number","and","shape","as","the","original","sub-graph",".","Not","following","this","could","crash","model","creation",",","or","introduce","bugs","in","the","new","model","graph",".","TODO","(","pulkitb",")",":","Consider","adding","list","of","input","layers","feeding","into","the","sub-graph",",","and","output","layers","feeding","from","the","tip","of","the","tree","as","parameters",".","These","would","be","needed","for","complex","replace","cases",".","Args",":","match_layer",":","Matched","sub-graph","based","on","`","self.pattern","(",")","`","."]
code: def replacement(self, match_layer):
      """Generate a replacement sub-graph for the matched sub-graph.
  
      The fundamental constraint of the replacement is that the replacement
      sub-graph should consume the same input tensors as the original sub-graph
      and also produce a final list of tensors which are same in number and shape
      as the original sub-graph. Not following this could crash model creation,
      or introduce bugs in the new model graph.
  
      TODO(pulkitb): Consider adding list of input layers feeding into the
      sub-graph, and output layers feeding from the tip of the tree as parameters.
      These would be needed for complex replace cases.
  
      Args:
        match_layer: Matched sub-graph based on `self.pattern()`.
      """
      raise NotImplementedError()
  
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 2 for calling the Transform obj's underlying member method code with example usage: obj.replacement(match_layer) without return types