| 108 | } |
| 109 | |
| 110 | void EvalQuantized(TfLiteContext* context, TfLiteNode* node, |
| 111 | TfLiteConvParams* params, OpData* data, |
| 112 | const TfLiteTensor* input, const TfLiteTensor* filter, |
| 113 | const TfLiteTensor* bias, TfLiteTensor* im2col, |
| 114 | TfLiteTensor* hwcn_weights, TfLiteTensor* output) { |
| 115 | const int32_t input_offset = -input->params.zero_point; |
| 116 | const int32_t filter_offset = -filter->params.zero_point; |
| 117 | const int32_t output_offset = output->params.zero_point; |
| 118 | |
| 119 | ConvParams op_params; |
| 120 | op_params.padding_type = RuntimePaddingType(params->padding); |
| 121 | op_params.padding_values.width = data->padding.width; |
| 122 | op_params.padding_values.height = data->padding.height; |
| 123 | op_params.stride_width = params->stride_width; |
| 124 | op_params.stride_height = params->stride_height; |
| 125 | op_params.dilation_width_factor = params->dilation_width_factor; |
| 126 | op_params.dilation_height_factor = params->dilation_height_factor; |
| 127 | op_params.input_offset = input_offset; |
| 128 | op_params.weights_offset = filter_offset; |
| 129 | op_params.output_offset = output_offset; |
| 130 | op_params.output_multiplier = data->output_multiplier; |
| 131 | op_params.output_shift = -data->output_shift; |
| 132 | op_params.quantized_activation_min = data->output_activation_min; |
| 133 | op_params.quantized_activation_max = data->output_activation_max; |
| 134 | reference_ops::Conv(op_params, GetTensorShape(input), |
| 135 | GetTensorData<uint8_t>(input), GetTensorShape(filter), |
| 136 | GetTensorData<uint8_t>(filter), GetTensorShape(bias), |
| 137 | GetTensorData<int32_t>(bias), GetTensorShape(output), |
| 138 | GetTensorData<uint8_t>(output), GetTensorShape(im2col), |
| 139 | GetTensorData<uint8_t>(im2col), nullptr); |
| 140 | } |
| 141 | |
| 142 | void EvalFloat(TfLiteContext* context, TfLiteNode* node, |
| 143 | TfLiteConvParams* params, OpData* data, |
no test coverage detected