| 289 | |
| 290 | template <KernelType kernel_type> |
| 291 | void L2EvalFloat(TfLiteContext* context, TfLiteNode* node, |
| 292 | TfLitePoolParams* params, OpData* data, |
| 293 | const TfLiteTensor* input, TfLiteTensor* output) { |
| 294 | float activation_min, activation_max; |
| 295 | CalculateActivationRange(params->activation, &activation_min, |
| 296 | &activation_max); |
| 297 | #define TF_LITE_L2_POOL(type) \ |
| 298 | tflite::PoolParams op_params; \ |
| 299 | op_params.stride_height = params->stride_height; \ |
| 300 | op_params.stride_width = params->stride_width; \ |
| 301 | op_params.filter_height = params->filter_height; \ |
| 302 | op_params.filter_width = params->filter_width; \ |
| 303 | op_params.padding_values.height = data->padding.height; \ |
| 304 | op_params.padding_values.width = data->padding.width; \ |
| 305 | op_params.float_activation_min = activation_min; \ |
| 306 | op_params.float_activation_max = activation_max; \ |
| 307 | type::L2Pool(op_params, GetTensorShape(input), GetTensorData<float>(input), \ |
| 308 | GetTensorShape(output), GetTensorData<float>(output)) |
| 309 | if (kernel_type == kReference) { |
| 310 | TF_LITE_L2_POOL(reference_ops); |
| 311 | } else { |
| 312 | TF_LITE_L2_POOL(optimized_ops); |
| 313 | } |
| 314 | #undef TF_LITE_L2_POOL |
| 315 | } |
| 316 | |
| 317 | #undef TF_LITE_KERNEL_TYPE_DISPATCH |
| 318 |
nothing calls this directly
no test coverage detected