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

Function MaxEvalQuantizedInt8

tensorflow/lite/kernels/pooling.cc:262–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260
261template <KernelType kernel_type>
262void MaxEvalQuantizedInt8(TfLiteContext* context, TfLiteNode* node,
263 TfLitePoolParams* params, OpData* data,
264 const TfLiteTensor* input, TfLiteTensor* output) {
265 int32_t activation_min;
266 int32_t activation_max;
267 CalculateActivationRangeInt8(params->activation, output, &activation_min,
268 &activation_max);
269#define TF_LITE_MAX_POOL(type) \
270 tflite::PoolParams op_params; \
271 op_params.stride_height = params->stride_height; \
272 op_params.stride_width = params->stride_width; \
273 op_params.filter_height = params->filter_height; \
274 op_params.filter_width = params->filter_width; \
275 op_params.padding_values.height = data->padding.height; \
276 op_params.padding_values.width = data->padding.width; \
277 op_params.quantized_activation_min = activation_min; \
278 op_params.quantized_activation_max = activation_max; \
279 type::MaxPool(op_params, GetTensorShape(input), \
280 GetTensorData<int8_t>(input), GetTensorShape(output), \
281 GetTensorData<int8_t>(output))
282 if (kernel_type == kReference) {
283 TF_LITE_MAX_POOL(reference_integer_ops);
284 } else {
285 TF_LITE_MAX_POOL(optimized_integer_ops);
286 }
287#undef TF_LITE_MAX_POOL
288}
289
290template <KernelType kernel_type>
291void L2EvalFloat(TfLiteContext* context, TfLiteNode* node,

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected