MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / main

Function main

tensorflow/compiler/mlir/lite/quantization/lite/tfl_quantizer.cc:56–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54} // namespace mlir
55
56int 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}

Callers

nothing calls this directly

Calls 5

QuantizeAnnotatedModelFunction · 0.85
c_strMethod · 0.80
messageMethod · 0.45
getMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected