| 478 | |
| 479 | template <KernelType kernel_type> |
| 480 | void EvalQuantizedPerChannel(TfLiteContext* context, TfLiteNode* node, |
| 481 | TfLiteConvParams* params, OpData* data, |
| 482 | TfLiteTensor* input, TfLiteTensor* filter, |
| 483 | TfLiteTensor* bias, TfLiteTensor* output, |
| 484 | TfLiteTensor* im2col) { |
| 485 | ConvParams op_params; |
| 486 | op_params.input_offset = -input->params.zero_point; |
| 487 | op_params.output_offset = output->params.zero_point; |
| 488 | op_params.stride_height = params->stride_height; |
| 489 | op_params.stride_width = params->stride_width; |
| 490 | op_params.dilation_height_factor = params->dilation_height_factor; |
| 491 | op_params.dilation_width_factor = params->dilation_width_factor; |
| 492 | op_params.padding_values.height = data->padding.height; |
| 493 | op_params.padding_values.width = data->padding.width; |
| 494 | |
| 495 | switch (kernel_type) { |
| 496 | case kReference: { |
| 497 | reference_integer_ops::ConvPerChannel( |
| 498 | op_params, data->per_channel_output_multiplier.data(), |
| 499 | data->per_channel_output_shift.data(), GetTensorShape(input), |
| 500 | GetTensorData<int8>(input), GetTensorShape(filter), |
| 501 | GetTensorData<int8>(filter), GetTensorShape(bias), |
| 502 | GetTensorData<int32>(bias), GetTensorShape(output), |
| 503 | GetTensorData<int8>(output)); |
| 504 | break; |
| 505 | } |
| 506 | case kGenericOptimized: |
| 507 | case kMultithreadOptimized: |
| 508 | case kCblasOptimized: { |
| 509 | optimized_integer_ops::ConvPerChannel( |
| 510 | op_params, data->per_channel_output_multiplier.data(), |
| 511 | data->per_channel_output_shift.data(), GetTensorShape(input), |
| 512 | GetTensorData<int8>(input), GetTensorShape(filter), |
| 513 | GetTensorData<int8>(filter), GetTensorShape(bias), |
| 514 | GetTensorData<int32>(bias), GetTensorShape(output), |
| 515 | GetTensorData<int8>(output), GetTensorShape(im2col), |
| 516 | GetTensorData<int8>(im2col), |
| 517 | CpuBackendContext::GetFromContext(context)); |
| 518 | break; |
| 519 | } |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | template <KernelType kernel_type> |
| 524 | void EvalFloat(TfLiteContext* context, TfLiteNode* node, |
nothing calls this directly
no test coverage detected