| 60 | .SetShapeFn(Scalars); |
| 61 | |
| 62 | TEST_F(StructureVerifierTest, ValidGraphs) { |
| 63 | // With scope, ops gets registered automatically. |
| 64 | tensorflow::Scope s = tensorflow::Scope::NewRootScope(); |
| 65 | Output a = ops::Const(s.WithOpName("a"), 0.0f, {10, 10}); |
| 66 | ops::ShapeN b(s.WithOpName("b"), {a, a, a}); |
| 67 | |
| 68 | GraphDef graph; |
| 69 | TF_CHECK_OK(s.ToGraphDef(&graph)); |
| 70 | TF_EXPECT_OK(verifier_->Verify(graph)); |
| 71 | |
| 72 | // With graphdef directly, relies on REGISTER_OP to register ops |
| 73 | SetGraph( |
| 74 | "node { name: 'W1' op: 'TestParams' }" |
| 75 | "node { name: 'input' op: 'TestInput' }" |
| 76 | "node { name: 't1' op: 'TestMul' input: [ 'W1', 'input:1' ] }"); |
| 77 | |
| 78 | TF_EXPECT_OK(verifier_->Verify(graph_)); |
| 79 | } |
| 80 | |
| 81 | TEST_F(StructureVerifierTest, OpNotRegistered) { |
| 82 | SetGraph( |
nothing calls this directly
no test coverage detected