| 489 | |
| 490 | template <KernelType kernel_type> |
| 491 | TfLiteStatus EvalFloat(TfLiteContext* context, TfLiteNode* node, |
| 492 | TfLiteFullyConnectedParams* params, OpData* data, |
| 493 | const TfLiteTensor* input, const TfLiteTensor* filter, |
| 494 | const TfLiteTensor* bias, TfLiteTensor* output) { |
| 495 | float output_activation_min, output_activation_max; |
| 496 | CalculateActivationRange(params->activation, &output_activation_min, |
| 497 | &output_activation_max); |
| 498 | if (kernel_type == kReference) { |
| 499 | FullyConnectedParams op_params; |
| 500 | op_params.float_activation_min = output_activation_min; |
| 501 | op_params.float_activation_max = output_activation_max; |
| 502 | reference_ops::FullyConnected( |
| 503 | op_params, GetTensorShape(input), GetTensorData<float>(input), |
| 504 | GetTensorShape(filter), GetTensorData<float>(filter), |
| 505 | GetTensorShape(bias), GetTensorData<float>(bias), |
| 506 | GetTensorShape(output), GetTensorData<float>(output)); |
| 507 | } else if (kernel_type == kLegacyPie) { |
| 508 | return EvalPie(context, node, params, data, input, filter, bias, output); |
| 509 | } else { |
| 510 | FullyConnectedParams op_params; |
| 511 | op_params.float_activation_min = output_activation_min; |
| 512 | op_params.float_activation_max = output_activation_max; |
| 513 | optimized_ops::FullyConnected( |
| 514 | op_params, GetTensorShape(input), GetTensorData<float>(input), |
| 515 | GetTensorShape(filter), GetTensorData<float>(filter), |
| 516 | GetTensorShape(bias), GetTensorData<float>(bias), |
| 517 | GetTensorShape(output), GetTensorData<float>(output), |
| 518 | CpuBackendContext::GetFromContext(context)); |
| 519 | } |
| 520 | |
| 521 | return kTfLiteOk; |
| 522 | } |
| 523 | |
| 524 | template <KernelType kernel_type> |
| 525 | TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
nothing calls this directly
no test coverage detected