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

Function BM_GraphCreation

tensorflow/core/graph/graph_test.cc:705–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

703BENCHMARK(BM_InEdgeIteration)->ArgPair(1 << 15, 16);
704
705static void BM_GraphCreation(int iters, int num_nodes, int num_edges_per_node) {
706 testing::StopTiming();
707 const GraphDef graph_def =
708 test::CreateGraphDef(num_nodes, num_edges_per_node);
709 const auto registry = OpRegistry::Global();
710 GraphConstructorOptions opts;
711 // Warmup step.
712 Graph graph(registry);
713 TF_CHECK_OK(ConvertGraphDefToGraph(opts, graph_def, &graph));
714 int64 sum = 0;
715 testing::StartTiming();
716 for (int i = 0; i < iters; ++i) {
717 Graph graph(registry);
718 TF_CHECK_OK(ConvertGraphDefToGraph(opts, graph_def, &graph));
719 sum += graph.num_node_ids();
720 }
721 VLOG(1) << sum;
722 testing::StopTiming();
723}
724BENCHMARK(BM_GraphCreation)->ArgPair(10, 2);
725BENCHMARK(BM_GraphCreation)->ArgPair(1 << 6, 2);
726BENCHMARK(BM_GraphCreation)->ArgPair(1 << 9, 2);

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected