code: def partition_all_graphs(
      graph_name_to_graph_def: Mapping[str, tf.compat.v1.GraphDef],
      graph_name_to_output_names: Mapping[str, List[str]],
  ) -> Dict[str, List[execution_spec.ExecutionSpec]]:
      """Partitions all the graphs.
  
      For each graph, the partitioning algorithm takes in the graph's `GraphDef`
      proto and output names, partitions the graph, and returns a list of
      ExecutionSpecs. Later, the beam_pipeline library can take in the
      ExecutionSpecs and execute the partitioned subgraphs.
  
      Args:
        graph_name_to_graph_def: A mapping from graph names to `GraphDef` protos.
        graph_name_to_output_names: A mapping from graph names to lists of their
          output node names.
  
      Returns:
        A mapping from graph names to a list of ExecutionSpecs, where the order
        of the list represents the order of execution.
      """
      graph_name_to_specs = {}
      for graph_name in graph_name_to_graph_def:
          specs = _partition_one_graph(
              graph_name_to_graph_def[graph_name],
              graph_name_to_output_names[graph_name],
          )
          graph_name_to_specs[graph_name] = specs
      return graph_name_to_specs
  
imports: import collections
  from typing import Dict, List, Mapping, Set
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.experimental.distributed_inference.graphdef_experiments.subgraph_partitioning import execution_spec
label_desc: Use image node_id 3 for calling a global function with example usage: partition_all_graphs(graph_name_to_graph_def, graph_name_to_output_names) and returns: graph_name_to_specs