| 204 | |
| 205 | template <KernelType kernel_type> |
| 206 | void MaxEvalFloat(TfLiteContext* context, TfLiteNode* node, |
| 207 | TfLitePoolParams* params, OpData* data, |
| 208 | const TfLiteTensor* input, TfLiteTensor* output) { |
| 209 | float activation_min, activation_max; |
| 210 | CalculateActivationRange(params->activation, &activation_min, |
| 211 | &activation_max); |
| 212 | #define TF_LITE_MAX_POOL(type) \ |
| 213 | tflite::PoolParams op_params; \ |
| 214 | op_params.stride_height = params->stride_height; \ |
| 215 | op_params.stride_width = params->stride_width; \ |
| 216 | op_params.filter_height = params->filter_height; \ |
| 217 | op_params.filter_width = params->filter_width; \ |
| 218 | op_params.padding_values.height = data->padding.height; \ |
| 219 | op_params.padding_values.width = data->padding.width; \ |
| 220 | op_params.float_activation_min = activation_min; \ |
| 221 | op_params.float_activation_max = activation_max; \ |
| 222 | type::MaxPool(op_params, GetTensorShape(input), GetTensorData<float>(input), \ |
| 223 | GetTensorShape(output), GetTensorData<float>(output)) |
| 224 | if (kernel_type == kReference) { |
| 225 | TF_LITE_MAX_POOL(reference_ops); |
| 226 | } else { |
| 227 | TF_LITE_MAX_POOL(optimized_ops); |
| 228 | } |
| 229 | #undef TF_LITE_MAX_POOL |
| 230 | } |
| 231 | |
| 232 | template <KernelType kernel_type> |
| 233 | void MaxEvalQuantizedUInt8(TfLiteContext* context, TfLiteNode* node, |
nothing calls this directly
no test coverage detected