MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BM_ToGraphDef

Function BM_ToGraphDef

tensorflow/core/graph/graph_test.cc:745–763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

743BENCHMARK(BM_GraphCreation)->ArgPair(1 << 15, 16);
744
745static 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}
764BENCHMARK(BM_ToGraphDef)->ArgPair(10, 2);
765BENCHMARK(BM_ToGraphDef)->ArgPair(1 << 6, 2);
766BENCHMARK(BM_ToGraphDef)->ArgPair(1 << 9, 2);

Callers

nothing calls this directly

Calls 5

StopTimingFunction · 0.85
ConvertGraphDefToGraphFunction · 0.85
StartTimingFunction · 0.85
CreateGraphDefFunction · 0.70
ToGraphDefMethod · 0.45

Tested by

no test coverage detected