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 _remove_redundant_nodes(self, operation_def, input_values):
      # Input values to be used as input to CreateSavedModel.
      # Since some of the input values are generated from the redundant nodes,
      # those needs to be reconstructed with the final packed merge node.
      reconstructed_input_values = []
  
      (
          redundant_values,
          non_redundant_values,
      ) = self._get_redundant_and_non_redundant_input_values(
          input_values
      )
  
      # Keep track of the final packed merge combine node. For those input nodes
      # which are descendants of the redundant nodes, we would create a new node
      # generated from the final packed merge combine node.
      (
          final_packed_merge_combine,
          final_packed_merge_combine_tensor_bindings,
      ) = self._get_final_packed_combine_and_tensor_bindings(
          redundant_values
      )
      reconstructed_input_values.extend(
          final_packed_merge_combine_tensor_bindings
      )
  
      # Add the non-redundant nodes to the input values.
      reconstructed_input_values.extend(non_redundant_values)
  
      # Keep track of the info needed to reconstruct the descendents of the
      # redundant nodes.
      to_be_created_tensor_bindings = (
          self._get_to_be_created_tensor_bindings_info(redundant_values)
      )
  
      reconstructed_input_values.extend(
          self._create_tensor_bindings(
              to_be_created_tensor_bindings, final_packed_merge_combine
          )
      )
      assert len(input_values) == len(reconstructed_input_values)
      return nodes.OperationNode(
          operation_def, tuple(reconstructed_input_values)
      ).outputs
  
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 3 for calling the _RemoveRedundantPackedMergeCombineVisitor obj's underlying member method code with example usage: obj._remove_redundant_nodes(operation_def, input_values) and returns: nodes