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

Function CreateGraphDef

tensorflow/core/debug/grpc_session_debug_test.cc:52–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void CreateGraphDef(GraphDef* graph_def, string node_names[3]) {
53 Graph graph(OpRegistry::Global());
54
55 Tensor a_tensor(DT_FLOAT, TensorShape({1, 2}));
56 test::FillValues<float>(&a_tensor, {1.0, 2.0});
57 Node* a = test::graph::Constant(&graph, a_tensor);
58 node_names[0] = a->name();
59
60 Tensor b_tensor(DT_FLOAT, TensorShape({2, 1}));
61 test::FillValues<float>(&b_tensor, {2.0, 1.0});
62 Node* b = test::graph::Constant(&graph, b_tensor);
63 node_names[1] = b->name();
64
65 // c = a * b
66 Node* c = test::graph::Matmul(&graph, a, b, false, false);
67 node_names[2] = c->name();
68
69 test::graph::ToGraphDef(&graph, graph_def);
70}
71
72// Asserts that "val" is a single float tensor. The only float is
73// "expected_val".

Callers 1

TEST_FFunction · 0.70

Calls 5

nameMethod · 0.65
TensorShapeClass · 0.50
ConstantFunction · 0.50
MatmulFunction · 0.50
ToGraphDefFunction · 0.50

Tested by

no test coverage detected