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

Function QuantizeModel

tensorflow/lite/tools/optimize/quantize_model.cc:642–659  ·  view source on GitHub ↗

Assumes that the operators in the model have been topologically sorted.

Source from the content-addressed store, hash-verified

640
641// Assumes that the operators in the model have been topologically sorted.
642TfLiteStatus QuantizeModel(flatbuffers::FlatBufferBuilder* builder,
643 ModelT* model, const TensorType& input_type,
644 const TensorType& output_type, bool allow_float,
645 ErrorReporter* error_reporter) {
646 TF_LITE_ENSURE_STATUS(
647 QuantizeWeightsInputOutput(model, allow_float, error_reporter));
648 TF_LITE_ENSURE_STATUS(ApplyConstraints(model, error_reporter));
649 TF_LITE_ENSURE_STATUS(QuantizeBiases(model, error_reporter));
650 utils::SetOperatorCodeVersion(model);
651 TF_LITE_ENSURE_STATUS(
652 SetInputAndOutputTypes(model, input_type, output_type, error_reporter));
653
654 flatbuffers::Offset<Model> output_model_location =
655 Model::Pack(*builder, model);
656 FinishModelBuffer(*builder, output_model_location);
657
658 return kTfLiteOk;
659}
660
661TfLiteStatus QuantizeModel(flatbuffers::FlatBufferBuilder* builder,
662 ModelT* model, const TensorType& input_type,

Callers 2

TEST_FFunction · 0.70
QuantizeModelMethod · 0.50

Calls 7

ApplyConstraintsFunction · 0.85
QuantizeBiasesFunction · 0.85
SetOperatorCodeVersionFunction · 0.85
SetInputAndOutputTypesFunction · 0.85
FinishModelBufferFunction · 0.85
PackClass · 0.50

Tested by 1

TEST_FFunction · 0.56