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

Function TfLiteQuantizationFree

tensorflow/lite/c/c_api_internal.c:97–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void TfLiteQuantizationFree(TfLiteQuantization* quantization) {
98 if (quantization->type == kTfLiteAffineQuantization) {
99 TfLiteAffineQuantization* q_params =
100 (TfLiteAffineQuantization*)(quantization->params);
101 if (q_params->scale) {
102 TfLiteFloatArrayFree(q_params->scale);
103 q_params->scale = NULL;
104 }
105 if (q_params->zero_point) {
106 TfLiteIntArrayFree(q_params->zero_point);
107 q_params->zero_point = NULL;
108 }
109 free(q_params);
110 }
111 quantization->params = NULL;
112 quantization->type = kTfLiteNoQuantization;
113}
114
115void TfLiteTensorFree(TfLiteTensor* t) {
116 TfLiteTensorDataFree(t);

Callers 4

operator()Method · 0.85
QuantizeTensorMethod · 0.85
TfLiteTensorFreeFunction · 0.85

Calls 2

TfLiteFloatArrayFreeFunction · 0.85
TfLiteIntArrayFreeFunction · 0.85

Tested by 1

QuantizeTensorMethod · 0.68