| 36 | REGISTER_OP("Int32Input").Output("o: int32"); |
| 37 | |
| 38 | TEST(ValidateGraphDefTest, TestValidGraph) { |
| 39 | const string graph_def_str = |
| 40 | "node { name: 'A' op: 'FloatInput' }" |
| 41 | "node { name: 'B' op: 'FloatInput' }" |
| 42 | "node { name: 'C' op: 'Mul' attr { key: 'T' value { type: DT_FLOAT } }" |
| 43 | " input: ['A', 'B'] }"; |
| 44 | GraphDef graph_def; |
| 45 | auto parser = protobuf::TextFormat::Parser(); |
| 46 | CHECK(parser.MergeFromString(graph_def_str, &graph_def)) << graph_def_str; |
| 47 | TF_ASSERT_OK(graph::ValidateGraphDef(graph_def, *OpRegistry::Global())); |
| 48 | } |
| 49 | |
| 50 | TEST(ValidateGraphDefTest, GraphWithUnspecifiedDefaultAttr) { |
| 51 | const string graph_def_str = |
nothing calls this directly
no test coverage detected