| 33 | }; |
| 34 | |
| 35 | GraphDef 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 | |
| 58 | Options Default() { |
| 59 | Options opts(1000, /* max_depth */ |
no test coverage detected