| 743 | BENCHMARK(BM_GraphCreation)->ArgPair(1 << 15, 16); |
| 744 | |
| 745 | static void BM_ToGraphDef(int iters, int num_nodes, int num_edges_per_node) { |
| 746 | testing::StopTiming(); |
| 747 | const GraphDef graph_def = |
| 748 | test::CreateGraphDef(num_nodes, num_edges_per_node); |
| 749 | const auto registry = OpRegistry::Global(); |
| 750 | GraphConstructorOptions opts; |
| 751 | // Warmup step. |
| 752 | Graph graph(registry); |
| 753 | TF_CHECK_OK(ConvertGraphDefToGraph(opts, graph_def, &graph)); |
| 754 | int64 sum = 0; |
| 755 | testing::StartTiming(); |
| 756 | for (int i = 0; i < iters; ++i) { |
| 757 | GraphDef graph_def; |
| 758 | graph.ToGraphDef(&graph_def); |
| 759 | sum += graph_def.node_size(); |
| 760 | } |
| 761 | VLOG(1) << sum; |
| 762 | testing::StopTiming(); |
| 763 | } |
| 764 | BENCHMARK(BM_ToGraphDef)->ArgPair(10, 2); |
| 765 | BENCHMARK(BM_ToGraphDef)->ArgPair(1 << 6, 2); |
| 766 | BENCHMARK(BM_ToGraphDef)->ArgPair(1 << 9, 2); |
nothing calls this directly
no test coverage detected