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

Function MakeGraphDef

tensorflow/core/lib/strings/proto_serialization_test.cc:30–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace tensorflow {
29namespace {
30GraphDef MakeGraphDef(int num_nodes) {
31 GraphDef graph_def;
32 for (int i = 0; i < num_nodes; ++i) {
33 NodeDef* node = graph_def.add_node();
34 node->set_name(strings::StrCat("node", i));
35 node->set_op(strings::StrCat("op", i % 10));
36 (*node->mutable_attr())["foo"].set_f(3.14f);
37 (*node->mutable_attr())["bar"].set_s("baz");
38 }
39 return graph_def;
40}
41} // namespace
42
43static void BM_ProtoSerializationToString(int iters, int num_nodes) {

Calls 3

set_opMethod · 0.80
StrCatFunction · 0.70
set_nameMethod · 0.45

Tested by

no test coverage detected