| 209 | } |
| 210 | |
| 211 | Status StrippedOpListForGraph(const GraphDef& graph_def, |
| 212 | const OpRegistryInterface& op_registry, |
| 213 | OpList* stripped_op_list) { |
| 214 | std::set<string> used_ops; |
| 215 | OpsUsedByGraph(graph_def, &used_ops); |
| 216 | |
| 217 | // Build the stripped op list in sorted order, ignoring functions. |
| 218 | stripped_op_list->clear_op(); |
| 219 | for (const string& op_name : used_ops) { |
| 220 | const OpDef* op_def; |
| 221 | TF_RETURN_IF_ERROR(op_registry.LookUpOpDef(op_name, &op_def)); |
| 222 | OpDef* stripped_op = stripped_op_list->add_op(); |
| 223 | stripped_op->CopyFrom(*op_def); |
| 224 | RemoveDescriptionsFromOpDef(stripped_op); |
| 225 | } |
| 226 | return Status::OK(); |
| 227 | } |
| 228 | |
| 229 | } // namespace tensorflow |