| 148 | } |
| 149 | |
| 150 | TfLiteStatus AverageEval(TfLiteContext* context, TfLiteNode* node) { |
| 151 | auto* params = reinterpret_cast<TfLitePoolParams*>(node->builtin_data); |
| 152 | OpData data; |
| 153 | |
| 154 | const TfLiteTensor* input = GetInput(context, node, kInputTensor); |
| 155 | TfLiteTensor* output = GetOutput(context, node, kOutputTensor); |
| 156 | |
| 157 | TF_LITE_ENSURE_STATUS(CalculateOpData(context, params, input, output, &data)); |
| 158 | |
| 159 | // Inputs and outputs share the same type, guarenteed by the converter. |
| 160 | switch (input->type) { |
| 161 | case kTfLiteFloat32: |
| 162 | AverageEvalFloat(context, node, params, &data, input, output); |
| 163 | break; |
| 164 | case kTfLiteUInt8: |
| 165 | AverageEvalUint8(context, node, params, &data, input, output); |
| 166 | break; |
| 167 | default: |
| 168 | context->ReportError(context, "Input type %s is not currently supported", |
| 169 | TfLiteTypeGetName(input->type)); |
| 170 | return kTfLiteError; |
| 171 | } |
| 172 | return kTfLiteOk; |
| 173 | } |
| 174 | |
| 175 | TfLiteStatus MaxEval(TfLiteContext* context, TfLiteNode* node) { |
| 176 | auto* params = reinterpret_cast<TfLitePoolParams*>(node->builtin_data); |
nothing calls this directly
no test coverage detected