class_docstr: A visitor that inspects the graph and removes redundant merge nodes.
  
  This visitor removes the redundant flatten and packed merge nodes added
  by the _PackMergeCombineVisitor and reconstructs the descendants of the
  removed nodes with the final flatten and packed merge node.
class_docstr_tok: ["A","visitor","that","inspects","the","graph","and","removes","redundant","merge","nodes",".","This","visitor","removes","the","redundant","flatten","and","packed","merge","nodes","added","by","the","_PackMergeCombineVisitor","and","reconstructs","the","descendants","of","the","removed","nodes","with","the","final","flatten","and","packed","merge","node","."]
code: def _is_packed_post_processing_node(
      self, value_node: nodes.ValueNode
  ) -> bool:
      # ValueNode is considered a packed post-processing node iff
      # PackedCombineMerge node is its ancestor.
      if value_node in self._packed_post_processing_nodes_cache:
          return self._packed_post_processing_nodes_cache[value_node]
  
      input_nodes = set()
      search_depth = 0
      result = False
      while (
          value_node.parent_operation.inputs
          and search_depth < _MAX_PACKED_POST_PROCESSING_DEPTH
      ):
          # Post-processing nodes form a tree. Looking only at the first input.
          input_nodes.add(value_node)
          value_node = value_node.parent_operation.inputs[0]
          if isinstance(
              value_node.parent_operation.operation_def,
              analyzer_nodes.PackedCombineMerge,
          ):
              result = True
              break
          search_depth += 1
      self._packed_post_processing_nodes_cache.update(
          {node: result for node in input_nodes}
      )
      return result
  
imports: import collections
  import dataclasses
  from typing import Sequence
  from tensorflow_transform import analyzer_nodes
  from tensorflow_transform import nodes
  from tensorflow_transform.beam import beam_nodes
label_desc: Use image node_id 4 for calling the _RemoveRedundantPackedMergeCombineVisitor obj's underlying member method code with example usage: obj._is_packed_post_processing_node(value_node) and returns: result, self