/external/tensorflow/tensorflow/lite/kernels/ |
D | kernel_util_test.cc | 255 input_params->zero_point = TfLiteIntArrayCreate(1); in TEST_F() 256 input_params->zero_point->data[0] = 5; in TEST_F() 277 filter_params->zero_point = TfLiteIntArrayCreate(3); in TEST_F() 278 filter_params->zero_point->data[0] = 0; in TEST_F() 279 filter_params->zero_point->data[1] = 0; in TEST_F() 280 filter_params->zero_point->data[2] = 0; in TEST_F() 298 bias_params->zero_point = TfLiteIntArrayCreate(3); in TEST_F() 299 bias_params->zero_point->data[0] = 11; in TEST_F() 300 bias_params->zero_point->data[1] = 12; in TEST_F() 301 bias_params->zero_point->data[2] = 15; in TEST_F() [all …]
|
D | quantize.cc | 152 op_params.zero_point = output->params.zero_point; in Eval() 183 input->params.zero_point, in Eval() 184 output->params.zero_point, in Eval() 199 data->output_shift, input->params.zero_point, in Eval() 200 output->params.zero_point, in Eval() 205 data->output_shift, input->params.zero_point, in Eval() 206 output->params.zero_point, in Eval() 221 data->output_shift, input->params.zero_point, in Eval() 222 output->params.zero_point, in Eval() 227 data->output_shift, input->params.zero_point, in Eval() [all …]
|
D | cpu_backend_gemm_custom_gemv.h | 192 std::uint8_t zero_point) { in Load16AndSubtractZeroPoint() argument 197 int16x8_t zero_point_vec = vdupq_n_s16(zero_point); in Load16AndSubtractZeroPoint() 204 std::int8_t zero_point) { in Load16AndSubtractZeroPoint() argument 209 int16x8_t zero_point_vec = vdupq_n_s16(zero_point); in Load16AndSubtractZeroPoint() 216 std::uint8_t zero_point) { in Load8AndSubtractZeroPoint() argument 219 int16x8_t zero_point_vec = vdupq_n_s16(zero_point); in Load8AndSubtractZeroPoint() 224 std::int8_t zero_point) { in Load8AndSubtractZeroPoint() argument 227 int16x8_t zero_point_vec = vdupq_n_s16(zero_point); in Load8AndSubtractZeroPoint() 367 Load16AndSubtractZeroPoint(rhs_data + in, rhs_params.zero_point); 369 Load16AndSubtractZeroPoint(local_filter_ptr, lhs_params.zero_point); [all …]
|
D | pad.cc | 182 TF_LITE_ENSURE(context, op_context.output->params.zero_point >= in Eval() 184 TF_LITE_ENSURE(context, op_context.output->params.zero_point <= in Eval() 186 pad_value = static_cast<uint8_t>(op_context.output->params.zero_point); in Eval() 190 TF_LITE_ENSURE_EQ(context, op_context.output->params.zero_point, in Eval() 191 op_context.constant_values->params.zero_point); in Eval() 215 TF_LITE_ENSURE(context, op_context.output->params.zero_point >= in Eval() 217 TF_LITE_ENSURE(context, op_context.output->params.zero_point <= in Eval() 219 pad_value = static_cast<int8_t>(op_context.output->params.zero_point); in Eval() 223 TF_LITE_ENSURE_EQ(context, op_context.output->params.zero_point, in Eval() 224 op_context.constant_values->params.zero_point); in Eval()
|
D | test_util.h | 51 int32_t zero_point) { in Quantize() argument 57 std::round(zero_point + (f / scale)))))); in Quantize() 64 int32_t zero_point) { in Dequantize() argument 68 f.push_back(scale * (q - zero_point)); in Dequantize() 95 int32_t zero_point = 0, bool per_channel_quantization = false, 104 zero_point(zero_point), in type() 116 int32_t zero_point; member 172 const std::vector<int64_t>& zero_point); 210 auto q = Quantize<T>(data, t->params.scale, t->params.zero_point); in QuantizeAndPopulate() 286 int32_t GetZeroPoint(int id) { return tensor_data_.at(id).zero_point; } in GetZeroPoint() [all …]
|
D | cpu_backend_gemm_gemmlowp.h | 96 scale_stage.result_offset_after_shift = dst_params.zero_point; 114 &gemmlowp_dst, -lhs_params.zero_point, -rhs_params.zero_point, 121 &gemmlowp_dst, -lhs_params.zero_point, -rhs_params.zero_point, 161 scale_stage.result_offset_after_shift = dst_params.zero_point; 177 -lhs_params.zero_point, -rhs_params.zero_point, output_pipeline);
|
D | activations.cc | 104 TF_LITE_ENSURE_EQ(context, output->params.zero_point, 0); in CheckOutputQuantParams() 106 TF_LITE_ENSURE_EQ(context, output->params.zero_point, -128); in CheckOutputQuantParams() 121 input->params.scale * (val - input->params.zero_point); in PopulateLookupTable() 125 static_cast<int32_t>(rescaled + output->params.zero_point); in PopulateLookupTable() 197 output->params.zero_point + in QuantizedReluX() 204 output->params.zero_point + in QuantizedReluX() 206 params.input_offset = input->params.zero_point; in QuantizedReluX() 207 params.output_offset = output->params.zero_point; in QuantizedReluX() 329 params->input_zero_point = input->params.zero_point; in HardSwishPrepare() 330 params->output_zero_point = output->params.zero_point; in HardSwishPrepare() [all …]
|
D | reduce.cc | 304 input->params.zero_point, input->params.scale, in EvalMean() 307 op_context.output->params.zero_point, in EvalMean() 324 input->params.zero_point, input->params.scale, in EvalMean() 327 op_context.output->params.zero_point, in EvalMean() 412 GetTensorData<int8_t>(input), op_context.input->params.zero_point, in EvalMean() 415 op_context.output->params.zero_point); in EvalMean() 416 } else if (input->params.zero_point == in EvalMean() 417 op_context.output->params.zero_point && in EvalMean() 433 GetTensorData<int8_t>(input), input->params.zero_point, in EvalMean() 436 op_context.output->params.zero_point, in EvalMean() [all …]
|
D | sub.cc | 97 input1_quantization_params.zero_point >= integer_type_min); in Prepare8BitSubOp() 99 input1_quantization_params.zero_point <= integer_type_max); in Prepare8BitSubOp() 101 input2_quantization_params.zero_point >= integer_type_min); in Prepare8BitSubOp() 103 input2_quantization_params.zero_point <= integer_type_max); in Prepare8BitSubOp() 105 output_quantization_params.zero_point >= integer_type_min); in Prepare8BitSubOp() 107 output_quantization_params.zero_point <= integer_type_max); in Prepare8BitSubOp() 109 op_params->input1_offset = -input1_quantization_params.zero_point; in Prepare8BitSubOp() 110 op_params->input2_offset = -input2_quantization_params.zero_point; in Prepare8BitSubOp() 111 op_params->output_offset = output_quantization_params.zero_point; in Prepare8BitSubOp() 153 TF_LITE_ENSURE_EQ(context, input1->params.zero_point, 0); in PrepareInt16SubOp() [all …]
|
/external/tensorflow/tensorflow/lite/micro/kernels/ |
D | quantize_test.cc | 30 T* golden_quantized, float scale, int zero_point, in TestQuantize() argument 39 output_data, output_dims, scale, zero_point, "output_tensor"); in TestQuantize() 43 int zero_points[] = {1, zero_point}; in TestQuantize() 45 quant.zero_point = IntArrayFromInts(zero_points); in TestQuantize() 100 zero_point); in TestQuantize() 118 const int zero_point = 127; in TF_LITE_MICRO_TEST() local 122 scale, zero_point, output); in TF_LITE_MICRO_TEST() 131 const int zero_point = 127; in TF_LITE_MICRO_TEST() local 135 scale, zero_point, output); in TF_LITE_MICRO_TEST() 144 const int zero_point = -1; in TF_LITE_MICRO_TEST() local [all …]
|
D | dequantize_test.cc | 29 T* input_data_quantized, float scale, int zero_point, in TestDequantize() argument 39 int zero_points_array[] = {1, zero_point}; in TestDequantize() 42 quant.zero_point = IntArrayFromInts(zero_points_array); in TestDequantize() 46 zero_point, "input_tensor"); in TestDequantize() 116 const int zero_point = 127; in TF_LITE_MICRO_TEST() local 120 zero_point, dims, values, output); in TF_LITE_MICRO_TEST() 129 const int zero_point = -1; in TF_LITE_MICRO_TEST() local 133 zero_point, dims, values, output); in TF_LITE_MICRO_TEST()
|
D | pad.cc | 145 TF_LITE_ENSURE(context, op_context.output->params.zero_point >= in Eval() 147 TF_LITE_ENSURE(context, op_context.output->params.zero_point <= in Eval() 149 pad_value = static_cast<uint8_t>(op_context.output->params.zero_point); in Eval() 153 TF_LITE_ENSURE_EQ(context, op_context.output->params.zero_point, in Eval() 154 op_context.constant_values->params.zero_point); in Eval() 171 TF_LITE_ENSURE(context, op_context.output->params.zero_point >= in Eval() 173 TF_LITE_ENSURE(context, op_context.output->params.zero_point <= in Eval() 175 pad_value = static_cast<int8_t>(op_context.output->params.zero_point); in Eval() 179 TF_LITE_ENSURE_EQ(context, op_context.output->params.zero_point, in Eval() 180 op_context.constant_values->params.zero_point); in Eval()
|
/external/XNNPACK/src/requantization/ |
D | precise-scalar.c | 22 uint8_t zero_point, in xnn_requantize_precise__scalar_unsigned32() argument 41 const int32_t smin = (int32_t)(uint32_t) qmin - (int32_t)(uint32_t) zero_point; in xnn_requantize_precise__scalar_unsigned32() 42 const int32_t smax = (int32_t)(uint32_t) qmax - (int32_t)(uint32_t) zero_point; in xnn_requantize_precise__scalar_unsigned32() 118 const int32_t x_biased = x_clamped + zero_point; in xnn_requantize_precise__scalar_unsigned32() 119 const int32_t y_biased = y_clamped + zero_point; in xnn_requantize_precise__scalar_unsigned32() 120 const int32_t z_biased = z_clamped + zero_point; in xnn_requantize_precise__scalar_unsigned32() 121 const int32_t w_biased = w_clamped + zero_point; in xnn_requantize_precise__scalar_unsigned32() 135 uint8_t zero_point, in xnn_requantize_precise__scalar_unsigned64() argument 151 const int32_t smin = (int32_t)(uint32_t) qmin - (int32_t)(uint32_t) zero_point; in xnn_requantize_precise__scalar_unsigned64() 152 const int32_t smax = (int32_t)(uint32_t) qmax - (int32_t)(uint32_t) zero_point; in xnn_requantize_precise__scalar_unsigned64() [all …]
|
D | fp32-scalar.c | 22 uint8_t zero_point, in xnn_requantize_fp32__scalar_lrintf() argument 31 const long lmin = (long) ((int32_t)(uint32_t) qmin - (int32_t)(uint32_t) zero_point); in xnn_requantize_fp32__scalar_lrintf() 32 const long lmax = (long) ((int32_t)(uint32_t) qmax - (int32_t)(uint32_t) zero_point); in xnn_requantize_fp32__scalar_lrintf() 55 const int32_t x_biased = x_clamped + (int32_t)(uint32_t) zero_point; in xnn_requantize_fp32__scalar_lrintf() 56 const int32_t y_biased = y_clamped + (int32_t)(uint32_t) zero_point; in xnn_requantize_fp32__scalar_lrintf() 57 const int32_t z_biased = z_clamped + (int32_t)(uint32_t) zero_point; in xnn_requantize_fp32__scalar_lrintf() 58 const int32_t w_biased = w_clamped + (int32_t)(uint32_t) zero_point; in xnn_requantize_fp32__scalar_lrintf() 72 uint8_t zero_point, in xnn_requantize_fp32__scalar_magic() argument 81 const float fmin = (float) ((int32_t)(uint32_t) qmin - (int32_t)(uint32_t) zero_point); in xnn_requantize_fp32__scalar_magic() 82 const float fmax = (float) ((int32_t)(uint32_t) qmax - (int32_t)(uint32_t) zero_point); in xnn_requantize_fp32__scalar_magic() [all …]
|
D | q31-scalar.c | 22 uint8_t zero_point, in xnn_requantize_q31__scalar() argument 47 const int32_t smin = (int32_t)(uint32_t) qmin - (int32_t)(uint32_t) zero_point; in xnn_requantize_q31__scalar() 48 const int32_t smax = (int32_t)(uint32_t) qmax - (int32_t)(uint32_t) zero_point; in xnn_requantize_q31__scalar() 118 const int32_t x_biased = x_clamped + zero_point; in xnn_requantize_q31__scalar() 119 const int32_t y_biased = y_clamped + zero_point; in xnn_requantize_q31__scalar() 120 const int32_t z_biased = z_clamped + zero_point; in xnn_requantize_q31__scalar() 121 const int32_t w_biased = w_clamped + zero_point; in xnn_requantize_q31__scalar()
|
D | gemmlowp-scalar.c | 24 uint8_t zero_point, in xnn_requantize_gemmlowp__scalar() argument 60 const int32_t x_biased = x_scaled + zero_point; in xnn_requantize_gemmlowp__scalar() 61 const int32_t y_biased = y_scaled + zero_point; in xnn_requantize_gemmlowp__scalar() 62 const int32_t z_biased = z_scaled + zero_point; in xnn_requantize_gemmlowp__scalar() 63 const int32_t w_biased = w_scaled + zero_point; in xnn_requantize_gemmlowp__scalar()
|
/external/tensorflow/tensorflow/lite/kernels/internal/reference/ |
D | dequantize.h | 33 int32 zero_point = op_params.zero_point; in Dequantize() local 39 const OutputT result = static_cast<OutputT>(scale * (val - zero_point)); in Dequantize() 51 int32 zero_point = op_params.zero_point; in DequantizeInteger() local 58 static_cast<OutputT>(round(scale * (val - zero_point))); in DequantizeInteger()
|
/external/tensorflow/tensorflow/lite/g3doc/performance/ |
D | quantization_spec.md | 41 `zero_point` per slice in the `quantized_dimension`. The quantized dimension 44 quantization params: `scale=[1.0, 2.0, 3.0]`, `zero_point=[1, 2, 3]`, 47 t[:, 0, :, :] will have scale[0]=1.0, zero_point[0]=1 48 t[:, 1, :, :] will have scale[1]=2.0, zero_point[1]=2 49 t[:, 2, :, :] will have scale[2]=3.0, zero_point[2]=3 126 restriction: Input and outputs must all have same scale/zero_point 137 restriction: Input and outputs must all have same scale/zero_point 148 restriction: zero_point = 0 153 restriction: (scale, zero_point) = (input0_scale * input1_scale[...], 0) 168 restriction: zero_point = 0 [all …]
|
/external/tensorflow/tensorflow/lite/tools/optimize/ |
D | quantization_utils_test.cc | 86 ASSERT_EQ(params.zero_point.size(), 1); in TEST_F() 90 int64_t zero_point = params.zero_point[0]; in TEST_F() local 93 EXPECT_EQ(zero_point, 0); in TEST_F() 110 ASSERT_EQ(params.zero_point.size(), 1); in TEST_F() 113 int64_t zero_point = params.zero_point[0]; in TEST_F() local 116 EXPECT_EQ(zero_point, -128); in TEST_F() 133 ASSERT_EQ(params.zero_point.size(), 1); in TEST_F() 136 int64_t zero_point = params.zero_point[0]; in TEST_F() local 139 EXPECT_EQ(zero_point, 127); in TEST_F() 154 ASSERT_EQ(params.zero_point.size(), 1); in TEST_F() [all …]
|
D | quantization_utils.cc | 74 int64_t zero_point; in GetAsymmetricQuantizationParams() local 76 zero_point = static_cast<int64_t>(quant_min); in GetAsymmetricQuantizationParams() 78 zero_point = static_cast<int64_t>(quant_max); in GetAsymmetricQuantizationParams() 80 zero_point = static_cast<int64_t>(std::round(zero_point_from_min)); in GetAsymmetricQuantizationParams() 85 quantization_params->zero_point = std::vector<int64_t>(1, zero_point); in GetAsymmetricQuantizationParams() 385 tensor->quantization->zero_point = std::vector<int64_t>(1, 0); in SymmetricQuantizeTensorFromMinMax() 423 tensor->quantization->zero_point = std::vector<int64_t>(1, 0); in SymmetricQuantizeTensor() 474 const std::vector<int64_t>& zero_point, in AddQuantizationParams() argument 484 if (zero_point.size() != scales.size()) { in AddQuantizationParams() 488 zero_point.size(), scales.size()); in AddQuantizationParams() [all …]
|
D | quantize_model_test.cc | 62 ASSERT_EQ(quantized_quant_params.zero_point.size(), 1); in VerifyAsymmetricQuantizationScale() 293 EXPECT_EQ(subgraph->tensors[input_idx]->quantization->zero_point.size(), 1); in TEST_F() 294 EXPECT_EQ(subgraph->tensors[input_idx]->quantization->zero_point[0], 0); in TEST_F() 300 EXPECT_EQ(subgraph->tensors[output_idx]->quantization->zero_point.size(), in TEST_F() 302 EXPECT_EQ(subgraph->tensors[output_idx]->quantization->zero_point[0], 0); in TEST_F() 381 EXPECT_EQ(subgraph->tensors[0]->quantization->zero_point.size(), 1); in TEST_F() 383 EXPECT_FLOAT_EQ(subgraph->tensors[0]->quantization->zero_point[0], -128); in TEST_F() 387 EXPECT_EQ(subgraph->tensors[1]->quantization->zero_point.size(), 1); in TEST_F() 389 EXPECT_FLOAT_EQ(subgraph->tensors[1]->quantization->zero_point[0], -128); in TEST_F() 393 EXPECT_EQ(subgraph->tensors[2]->quantization->zero_point.size(), 1); in TEST_F() [all …]
|
/external/tensorflow/tensorflow/lite/micro/ |
D | test_helpers.h | 79 float scale, int zero_point, 84 int zero_point, const char* name, 88 float scale, int zero_point, 92 float scale, int zero_point, 97 int zero_point, const char* name,
|
D | micro_utils.h | 30 const int zero_point); 35 const int zero_point); 56 float scale, int zero_point = 0); 59 float scale, int zero_point = 128);
|
D | micro_utils.cc | 55 const int zero_point) { in FloatToAsymmetricQuantizedUInt8() argument 56 int32_t result = round(value / scale) + zero_point; in FloatToAsymmetricQuantizedUInt8() 78 const int zero_point) { in FloatToAsymmetricQuantizedInt8() argument 80 zero_point - kAsymmetricInt8Min) + in FloatToAsymmetricQuantizedInt8() 100 float scale, int zero_point) { in AsymmetricQuantize() argument 102 output[i] = FloatToAsymmetricQuantizedInt8(input[i], scale, zero_point); in AsymmetricQuantize() 107 float scale, int zero_point) { in AsymmetricQuantize() argument 109 output[i] = FloatToAsymmetricQuantizedUInt8(input[i], scale, zero_point); in AsymmetricQuantize()
|
/external/tensorflow/tensorflow/lite/micro/kernels/cmsis-nn/ |
D | fully_connected.cc | 107 accum_depth, output_depth, batches, -input->params.zero_point, in EvalQuantizedInt8() 108 -filter->params.zero_point, data->output_multiplier, in EvalQuantizedInt8() 109 -data->output_shift, output->params.zero_point, in EvalQuantizedInt8() 118 op_params.input_offset = -input->params.zero_point; in EvalQuantizedInt8() 119 op_params.weights_offset = -filter->params.zero_point; in EvalQuantizedInt8() 120 op_params.output_offset = output->params.zero_point; in EvalQuantizedInt8() 141 const int32_t input_offset = -input->params.zero_point; in EvalQuantized() 142 const int32_t filter_offset = -filter->params.zero_point; in EvalQuantized() 143 const int32_t output_offset = output->params.zero_point; in EvalQuantized()
|