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

Function AverageEvalQuantizedInt8

tensorflow/lite/kernels/pooling.cc:174–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172
173template <KernelType kernel_type>
174TfLiteStatus AverageEvalQuantizedInt8(TfLiteContext* context, TfLiteNode* node,
175 TfLitePoolParams* params, OpData* data,
176 const TfLiteTensor* input,
177 TfLiteTensor* output) {
178 int32_t activation_min;
179 int32_t activation_max;
180 CalculateActivationRangeInt8(params->activation, output, &activation_min,
181 &activation_max);
182#define TF_LITE_AVERAGE_POOL(type) \
183 tflite::PoolParams op_params; \
184 op_params.stride_height = params->stride_height; \
185 op_params.stride_width = params->stride_width; \
186 op_params.filter_height = params->filter_height; \
187 op_params.filter_width = params->filter_width; \
188 op_params.padding_values.height = data->padding.height; \
189 op_params.padding_values.width = data->padding.width; \
190 op_params.quantized_activation_min = activation_min; \
191 op_params.quantized_activation_max = activation_max; \
192 TF_LITE_ENSURE(context, type::AveragePool(op_params, GetTensorShape(input), \
193 GetTensorData<int8_t>(input), \
194 GetTensorShape(output), \
195 GetTensorData<int8_t>(output)))
196 if (kernel_type == kReference) {
197 TF_LITE_AVERAGE_POOL(reference_integer_ops);
198 } else {
199 TF_LITE_AVERAGE_POOL(optimized_integer_ops);
200 }
201#undef TF_LITE_AVERAGE_POOL
202 return kTfLiteOk;
203}
204
205template <KernelType kernel_type>
206void MaxEvalFloat(TfLiteContext* context, TfLiteNode* node,

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected