| 110 | |
| 111 | template <KernelType kernel_type> |
| 112 | TfLiteStatus AverageEvalFloat(TfLiteContext* context, TfLiteNode* node, |
| 113 | TfLitePoolParams* params, OpData* data, |
| 114 | const TfLiteTensor* input, TfLiteTensor* output) { |
| 115 | float activation_min, activation_max; |
| 116 | CalculateActivationRange(params->activation, &activation_min, |
| 117 | &activation_max); |
| 118 | #define TF_LITE_AVERAGE_POOL(type) \ |
| 119 | tflite::PoolParams op_params; \ |
| 120 | op_params.stride_height = params->stride_height; \ |
| 121 | op_params.stride_width = params->stride_width; \ |
| 122 | op_params.filter_height = params->filter_height; \ |
| 123 | op_params.filter_width = params->filter_width; \ |
| 124 | op_params.padding_values.height = data->padding.height; \ |
| 125 | op_params.padding_values.width = data->padding.width; \ |
| 126 | op_params.float_activation_min = activation_min; \ |
| 127 | op_params.float_activation_max = activation_max; \ |
| 128 | TF_LITE_ENSURE(context, type::AveragePool(op_params, GetTensorShape(input), \ |
| 129 | GetTensorData<float>(input), \ |
| 130 | GetTensorShape(output), \ |
| 131 | GetTensorData<float>(output))) |
| 132 | if (kernel_type == kReference) { |
| 133 | TF_LITE_AVERAGE_POOL(reference_ops); |
| 134 | } else { |
| 135 | TF_LITE_AVERAGE_POOL(optimized_ops); |
| 136 | } |
| 137 | #undef TF_LITE_AVERAGE_POOL |
| 138 | return kTfLiteOk; |
| 139 | } |
| 140 | |
| 141 | template <KernelType kernel_type> |
| 142 | TfLiteStatus AverageEvalQuantizedUint8(TfLiteContext* context, TfLiteNode* node, |
nothing calls this directly
no test coverage detected