| 29 | namespace graph { |
| 30 | |
| 31 | Status ValidateGraphDef(const GraphDef& graph_def, |
| 32 | const OpRegistryInterface& op_registry) { |
| 33 | Status s; |
| 34 | const int version = graph_def.versions().producer(); |
| 35 | for (const NodeDef& node_def : graph_def.node()) { |
| 36 | // Look up the OpDef for the node_def's op name. |
| 37 | const OpDef* op_def; |
| 38 | TF_RETURN_IF_ERROR(op_registry.LookUpOpDef(node_def.op(), &op_def)); |
| 39 | TF_RETURN_IF_ERROR(ValidateNodeDef(node_def, *op_def)); |
| 40 | TF_RETURN_IF_ERROR(CheckOpDeprecation(*op_def, version)); |
| 41 | } |
| 42 | |
| 43 | return s; |
| 44 | } |
| 45 | |
| 46 | Status ValidateGraphDefAgainstOpRegistry( |
| 47 | const GraphDef& graph_def, const OpRegistryInterface& op_registry) { |