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

Function CreateGraphDef

tensorflow/cc/profiler/profiler_test.cc:35–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33};
34
35GraphDef CreateGraphDef() {
36 Scope root = Scope::NewRootScope();
37
38 auto a = ops::Const<float>(root, {{3, 2}, {-1, 0}});
39
40 auto x = ops::Const(root.WithOpName("x"), {{1.f}, {1.f}});
41
42 auto y = ops::MatMul(root.WithOpName("y"), a, x);
43
44 auto y2 = ops::Square(root, y);
45
46 auto y2_sum = ops::Sum(root, y2, 0);
47
48 auto y_norm = ops::Sqrt(root, y2_sum);
49
50 auto y_div = ops::Div(root.WithOpName("y_normalized"), y, y_norm);
51
52 GraphDef def;
53 TF_CHECK_OK(root.ToGraphDef(&def));
54
55 return def;
56}
57
58Options Default() {
59 Options opts(1000, /* max_depth */

Callers 1

TEST_FFunction · 0.70

Calls 8

WithOpNameMethod · 0.80
ConstFunction · 0.50
MatMulFunction · 0.50
SquareFunction · 0.50
SumClass · 0.50
SqrtClass · 0.50
DivFunction · 0.50
ToGraphDefMethod · 0.45

Tested by

no test coverage detected