- tflite::reference_ops::AveragePool(params, getTensorShape(input()), getTensorData<float>(input()),
- getTensorShape(output()), getTensorData<float>(output()));
-}
-
-void AveragePool2D::evalQuantized() const
-{
- int32_t activation_min{};
- int32_t activation_max{};
- calculateActivationRangeQuantized(_params.activation, output(), &activation_min, &activation_max);
-
- tflite::PoolParams params{};
- params.padding_values.height = _padding_height;
- params.padding_values.width = _padding_width;
- params.stride_height = _params.stride_height;
- params.stride_width = _params.stride_width;
- params.filter_height = _params.filter_height;
- params.filter_width = _params.filter_width;
- params.quantized_activation_min = activation_min;
- params.quantized_activation_max = activation_max;
-
- tflite::reference_ops::AveragePool(params, getTensorShape(input()),
- getTensorData<uint8_t>(input()), getTensorShape(output()),
- getTensorData<uint8_t>(output()));
-}
-
-void AveragePool2D::evalSInt8() const
-{
- int32_t activation_min{};
- int32_t activation_max{};
- calculateActivationRangeQuantized(_params.activation, output(), &activation_min, &activation_max);
- tflite::PoolParams params{};
- params.padding_values.height = _padding_height;
- params.padding_values.width = _padding_width;
- params.stride_height = _params.stride_height;
- params.stride_width = _params.stride_width;
- params.filter_height = _params.filter_height;
- params.filter_width = _params.filter_width;
- params.quantized_activation_min = activation_min;
- params.quantized_activation_max = activation_max;
-
- auto scratchpad = getOutputTensors()[1];
- int8_t *scratchpad_data = nullptr;
- if (scratchpad->is_allocatable())
- scratchpad_data = scratchpad->data<int8_t>();
-
- luci_interpreter_pal::AveragePool<int8_t>(
- params, getTensorShape(input()), getTensorData<int8_t>(input()), getTensorShape(output()),
- getTensorData<int8_t>(output()), getTensorShape(scratchpad), scratchpad_data);
-}
-
-void AveragePool2D::evalSInt16() const
-{
- int32_t activation_min{};
- int32_t activation_max{};
- calculateActivationRangeQuantized(_params.activation, output(), &activation_min, &activation_max);
-
- tflite::PoolParams params{};
- params.padding_values.height = _padding_height;
- params.padding_values.width = _padding_width;
- params.stride_height = _params.stride_height;
- params.stride_width = _params.stride_width;
- params.filter_height = _params.filter_height;
- params.filter_width = _params.filter_width;
- params.quantized_activation_min = activation_min;
- params.quantized_activation_max = activation_max;
-
- tflite::reference_integer_ops::AveragePool(
- params, getTensorShape(input()), getTensorData<int16_t>(input()), //
- getTensorShape(output()), getTensorData<int16_t>(output()));