class_docstr: A set of tests for the graph partitioning library.
class_docstr_tok: ["A","set","of","tests","for","the","graph","partitioning","library","."]
docstr: Checks if the partitioned subgraphs match the golden set.
docstr_tok: ["Checks","if","the","partitioned","subgraphs","match","the","golden","set","."]
code: def test_subgraphs_with_golden_set(self):
      """Checks if the partitioned subgraphs match the golden set."""
      for graph_name, specs in self.graph_name_to_specs.items():
          for spec in specs:
              if spec.is_remote_op:
                  continue
              golden_graph_def = _get_golden_subgraph(graph_name, spec)
              # Compare node names instead of `GraphDef` protos because sets in
              # graph_partition are not ordered. If there are two nodes with the
              # same type in a subgraph layer, for example Add. Sometimes a node
              # may have name "Add" while other times have name "Add_1".
              self.assertEqual(
                  _get_node_names(golden_graph_def),
                  _get_node_names(spec.subgraph),
              )
  
file_path: tfx/tfx/experimental/distributed_inference/graphdef_experiments/subgraph_partitioning/graph_partition_test.py
imports: import os
  import tempfile
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.experimental.distributed_inference.graphdef_experiments.subgraph_partitioning import create_complex_graph
  from tfx.experimental.distributed_inference.graphdef_experiments.subgraph_partitioning import graph_partition
  from google.protobuf import text_format
label_desc: Use image node_id 4 for calling the PartitionTest obj's underlying member method code with example usage: obj.test_subgraphs_with_golden_set() without return types