| 96 | } // namespace |
| 97 | |
| 98 | int main(int argc, char** argv) { |
| 99 | string input_model; |
| 100 | string output_registration; |
| 101 | string tflite_path; |
| 102 | ParseFlagAndInit(argc, argv, &input_model, &output_registration, |
| 103 | &tflite_path); |
| 104 | |
| 105 | std::vector<string> builtin_ops; |
| 106 | std::vector<string> custom_ops; |
| 107 | std::ifstream fin(input_model); |
| 108 | std::stringstream content; |
| 109 | content << fin.rdbuf(); |
| 110 | // Need to store content data first, otherwise, it won't work in bazel. |
| 111 | string content_str = content.str(); |
| 112 | const ::tflite::Model* model = ::tflite::GetModel(content_str.data()); |
| 113 | ::tflite::ReadOpsFromModel(model, &builtin_ops, &custom_ops); |
| 114 | GenerateFileContent(tflite_path, output_registration, builtin_ops, |
| 115 | custom_ops); |
| 116 | return 0; |
| 117 | } |
nothing calls this directly
no test coverage detected