| 72 | } // namespace |
| 73 | |
| 74 | tensorflow::Status Convert(const string& graph_def_contents, |
| 75 | const TocoFlags& toco_flags, |
| 76 | const ModelFlags& model_flags, |
| 77 | string* output_file_contents) { |
| 78 | std::unique_ptr<Model> model = |
| 79 | Import(toco_flags, model_flags, graph_def_contents); |
| 80 | TF_RETURN_IF_ERROR(TransformWithStatus(toco_flags, model.get())); |
| 81 | return Export(toco_flags, *model, toco_flags.allow_custom_ops(), |
| 82 | output_file_contents); |
| 83 | } |
| 84 | |
| 85 | tensorflow::Status Convert(const ParsedTocoFlags& parsed_toco_flags, |
| 86 | const ParsedModelFlags& parsed_model_flags) { |