| 54 | } // namespace mlir |
| 55 | |
| 56 | int main(int argc, char** argv) { |
| 57 | llvm::InitLLVM y(argc, argv); |
| 58 | llvm::cl::ParseCommandLineOptions(argc, argv); |
| 59 | auto file_or_err = llvm::MemoryBuffer::getFileOrSTDIN(inputFileName.c_str()); |
| 60 | if (std::error_code error = file_or_err.getError()) { |
| 61 | llvm::errs() << argv[0] << ": could not open input file '" << inputFileName |
| 62 | << "': " << error.message() << "\n"; |
| 63 | return 1; |
| 64 | } |
| 65 | auto buffer = file_or_err->get(); |
| 66 | flatbuffers::FlatBufferBuilder builder; |
| 67 | auto status = |
| 68 | mlir::QuantizeAnnotatedModel(buffer->getBuffer().str(), &builder); |
| 69 | if (status != kTfLiteOk) { |
| 70 | return 1; |
| 71 | } |
| 72 | |
| 73 | std::cout << std::string( |
| 74 | reinterpret_cast<const char*>(builder.GetBufferPointer()), |
| 75 | builder.GetSize()) |
| 76 | << "\n"; |
| 77 | return 0; |
| 78 | } |
nothing calls this directly
no test coverage detected