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 _create_tensor_bindings(
      self, to_be_created_tensor_bindings, final_packed_merge_combine
  ):
      labels_to_new_nodes = {}
  
      def _maybe_create_node(op_def, inputs):
          if op_def.label in labels_to_new_nodes:
              return labels_to_new_nodes[op_def.label]
          new_node = nodes.OperationNode(op_def, inputs).outputs
          labels_to_new_nodes[op_def.label] = new_node
          return new_node
  
      result = []
      if to_be_created_tensor_bindings:
          assert final_packed_merge_combine is not None
          # Reconstruct the remaining inputs from the final packed merge node.
          for tensor_binding_info in to_be_created_tensor_bindings:
              intermediate_nodes = (final_packed_merge_combine,)
              for op_def in reversed(
                  tensor_binding_info.intermediate_post_processing_op_defs
              ):
                  intermediate_nodes = _maybe_create_node(
                      op_def, intermediate_nodes
                  )
                  if isinstance(
                      op_def,
                      analyzer_nodes.ExtractPackedCombineMergeOutputs,
                  ):
                      intermediate_nodes = (
                          intermediate_nodes[
                              tensor_binding_info.output_index
                          ],
                      )
              # The last node must be a single CreateTensorBinding.
              assert len(intermediate_nodes) == 1, intermediate_nodes
              assert isinstance(
                  intermediate_nodes[0].parent_operation.operation_def,
                  beam_nodes.CreateTensorBinding,
              ), intermediate_nodes[0]
              result.append(intermediate_nodes[0])
      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 8 for calling the _RemoveRedundantPackedMergeCombineVisitor obj's underlying member method code with example usage: obj._create_tensor_bindings(to_be_created_tensor_bindings, final_packed_merge_combine) and returns: result, new_node, labels_to_new_nodes