Check a generated list of subgraphs against the expected list of subgraphs.
| 99 | |
| 100 | // Check a generated list of subgraphs against the expected list of subgraphs. |
| 101 | void CheckPartitionSubgraphs( |
| 102 | const std::vector<NodeSubset>& generated_subgraphs, |
| 103 | const std::vector<NodeSubset>& expected_subgraphs) { |
| 104 | ASSERT_EQ(generated_subgraphs.size(), expected_subgraphs.size()); |
| 105 | for (size_t subgraph_index = 0; subgraph_index < generated_subgraphs.size(); |
| 106 | subgraph_index++) { |
| 107 | EXPECT_EQ(generated_subgraphs[subgraph_index].nodes, |
| 108 | expected_subgraphs[subgraph_index].nodes); |
| 109 | EXPECT_EQ(generated_subgraphs[subgraph_index].input_tensors, |
| 110 | expected_subgraphs[subgraph_index].input_tensors); |
| 111 | EXPECT_EQ(generated_subgraphs[subgraph_index].output_tensors, |
| 112 | expected_subgraphs[subgraph_index].output_tensors); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | // Test an empty trivial graph with no partitions. |
| 117 | TEST(PartitionTest, Nodes0PartitionNodes0) { |