MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / EvalQuantized

Function EvalQuantized

tensorflow/lite/kernels/transpose_conv.cc:345–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345void EvalQuantized(const TfLiteTransposeConvParams* params, OpData* data,
346 const TfLiteTensor* input, const TfLiteTensor* weights,
347 TfLiteTensor* col2im, TfLiteTensor* output,
348 TfLiteTensor* scratch_buffer) {
349 int32_t input_offset = -input->params.zero_point;
350 int32_t filter_offset = -weights->params.zero_point;
351 int32_t output_offset = output->params.zero_point;
352
353 tflite::ConvParams op_params;
354 op_params.padding_type = PaddingType::kSame;
355 op_params.padding_values.width = data->padding.width;
356 op_params.padding_values.height = data->padding.height;
357 op_params.stride_width = params->stride_width;
358 op_params.stride_height = params->stride_height;
359 op_params.input_offset = input_offset;
360 op_params.output_offset = output_offset;
361 op_params.weights_offset = filter_offset;
362 op_params.output_multiplier = data->output_multiplier;
363 op_params.output_shift = -data->output_shift;
364 op_params.quantized_activation_min = data->output_activation_min;
365 op_params.quantized_activation_max = data->output_activation_max;
366
367 // TODO(haoliang): Add optimized implementation later.
368 reference_ops::TransposeConv(
369 op_params, GetTensorShape(input), GetTensorData<uint8>(input),
370 GetTensorShape(weights), GetTensorData<uint8>(weights),
371 GetTensorShape(output), GetTensorData<uint8>(output),
372 GetTensorShape(col2im), GetTensorData<uint8>(col2im),
373 GetTensorData<int32_t>(scratch_buffer));
374}
375
376template <KernelType kernel_type>
377TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {

Callers 1

EvalFunction · 0.70

Calls 2

TransposeConvFunction · 0.50
GetTensorShapeFunction · 0.50

Tested by

no test coverage detected