Home
last modified time | relevance | path

Searched refs:zero_point (Results 1 – 25 of 36) sorted by relevance

12

/external/gemmlowp/doc/
Dquantization_example.cc66 std::uint8_t zero_point; member
110 result.zero_point = nudged_zero_point; in ChooseQuantizationParams()
138 const float transformed_val = qparams.zero_point + real_val / qparams.scale; in Quantize()
149 (*dst)[i] = qparams.scale * (quantized_val - qparams.zero_point); in Dequantize()
309 << ", zero_point = " << static_cast<float>(lhs_qparams.zero_point) in main()
313 << ", zero_point = " << static_cast<float>(rhs_qparams.zero_point) in main()
318 << static_cast<float>(result_qparams.zero_point) << std::endl; in main()
332 const int lhs_offset = -lhs_qparams.zero_point; in main()
333 const int rhs_offset = -rhs_qparams.zero_point; in main()
334 const int result_offset = result_qparams.zero_point; in main()
Dquantization.md80 In equation (1), plugging `real_value = 0` and `quantized_value = zero_point`,
84 0 = A * zero_point + B
90 zero_point = -B / A
95 `zero_point` can be exactly equal to it. Quite awkward!
98 `quantized_value = zero_point`, we get:
101 0 = C * (zero_point + D)
108 0 = zero_point + D
111 In other words, `D = -zero_point`. This suggests rewriting the quantization
116 real_value = scale * (quantized_value - zero_point) (3)
120 `-zero_point`.
[all …]
/external/tensorflow/tensorflow/contrib/lite/kernels/
Dtest_util.h39 int32_t zero_point) { in Quantize() argument
45 static_cast<T>(std::round(zero_point + (f / scale)))))); in Quantize()
52 int32_t zero_point) { in Dequantize() argument
55 f.push_back(scale * (q - zero_point)); in Dequantize()
85 int32_t zero_point; member
132 auto q = Quantize<T>(data, t->params.scale, t->params.zero_point); in QuantizeAndPopulate()
139 int32_t GetZeroPoint(int id) { return tensor_data_.at(id).zero_point; } in GetZeroPoint()
Dkernel_util.cc51 const auto zero_point = output->params.zero_point; in CalculateActivationRangeUint8() local
53 auto quantize = [scale, zero_point](float f) { in CalculateActivationRangeUint8()
54 return zero_point + static_cast<int32_t>(TfLiteRound(f / scale)); in CalculateActivationRangeUint8()
Dconcatenation.cc71 TF_LITE_ENSURE_EQ(context, t->params.zero_point, t0->params.zero_point); in Prepare()
91 TF_LITE_ENSURE_EQ(context, output->params.zero_point, in Prepare()
92 t0->params.zero_point); in Prepare()
Dtest_util.cc35 int32_t zero_point = std::min( in QuantizationParams() local
38 return {scale, zero_point}; in QuantizationParams()
64 std::tie(t.scale, t.zero_point) = in AddTensor()
67 std::tie(t.scale, t.zero_point) = in AddTensor()
78 builder_.CreateVector<int64_t>({t.zero_point})); in AddTensor()
Ddepthwise_conv.cc112 TF_LITE_ENSURE_EQ(context, bias->params.zero_point, 0); in Prepare()
201 auto input_offset = -input->params.zero_point; in EvalQuantized()
202 auto filter_offset = -filter->params.zero_point; in EvalQuantized()
203 auto output_offset = output->params.zero_point; in EvalQuantized()
Dmul.cc114 auto input1_offset = -input1->params.zero_point; in EvalQuantized()
115 auto input2_offset = -input2->params.zero_point; in EvalQuantized()
116 auto output_offset = output->params.zero_point; in EvalQuantized()
Dadd.cc114 auto input1_offset = -input1->params.zero_point; in EvalAddQuantized()
115 auto input2_offset = -input2->params.zero_point; in EvalAddQuantized()
116 auto output_offset = output->params.zero_point; in EvalAddQuantized()
Dfully_connected.cc184 int32_t input_offset = -input->params.zero_point; in EvalQuantized()
185 int32_t filter_offset = -filter->params.zero_point; in EvalQuantized()
186 int32_t output_offset = output->params.zero_point; in EvalQuantized()
Dconv.cc144 TF_LITE_ENSURE_EQ(context, bias->params.zero_point, 0); in Prepare()
298 auto input_offset = -input->params.zero_point; in EvalQuantized()
299 auto filter_offset = -filter->params.zero_point; in EvalQuantized()
300 auto output_offset = output->params.zero_point; in EvalQuantized()
Dactivations.cc76 TF_LITE_ENSURE_EQ(context, output->params.zero_point, 0); in SigmoidPrepare()
110 TF_LITE_ENSURE_EQ(context, output->params.zero_point, 0); in SoftmaxPrepare()
218 input->params.zero_point, data->input_range_radius, in SigmoidEval()
Dpooling.cc105 TF_LITE_ENSURE_EQ(context, input->params.zero_point, in GenericPrepare()
106 output->params.zero_point); in GenericPrepare()
/external/tensorflow/tensorflow/contrib/lite/toco/graph_transformations/
Dquantize.cc74 scaled_val = quantization_params.zero_point; in QuantizeBuffer()
76 scaled_val = quantization_params.zero_point + inverse_scale * src_val; in QuantizeBuffer()
214 quantization_params->zero_point = 0; in ChooseQuantizationForOperatorInput()
241 input, minmax.min, minmax.max, quantization_params->zero_point, in ChooseQuantizationForOperatorInput()
250 quantization_params.zero_point + real_value / quantization_params.scale; in IsExactlyRepresentable()
273 quantization_params->zero_point = 128; in ChooseHardcodedQuantizationForOperatorOutput()
288 quantization_params->zero_point = 0; in ChooseHardcodedQuantizationForOperatorOutput()
297 quantization_params->zero_point = 128; in ChooseHardcodedQuantizationForOperatorOutput()
332 quantization_params->zero_point = input_quantization_params.zero_point; in ChooseQuantizationForOperatorOutput()
358 output, minmax.min, minmax.max, quantization_params->zero_point, in ChooseQuantizationForOperatorOutput()
Dremove_trivial_quantized_activation_func.cc51 (0. - quantization_params.zero_point) * quantization_params.scale; in Run()
63 (255. - quantization_params.zero_point) * quantization_params.scale; in Run()
Dresolve_constant_fake_quant.cc63 std::round(qparams.zero_point + src_val / qparams.scale); in Run()
66 const double dst_val = qparams.scale * (quantized_val - qparams.zero_point); in Run()
Ddequantize.cc39 new_data[i] = qparams.scale * (old_data[i] - qparams.zero_point); in DequantizeBuffer()
62 const double new_mean_value = qparams.zero_point; in ClearArrayQuantizationParams()
/external/tensorflow/tensorflow/contrib/lite/toco/tflite/
Dimport.cc84 if (quantization->scale() && quantization->zero_point()) { in ImportTensors()
86 CHECK_EQ(1, quantization->zero_point()->Length()); in ImportTensors()
89 q.zero_point = quantization->zero_point()->Get(0); in ImportTensors()
Dexport.cc117 Offset<Vector<int64_t>> zero_point; in ExportTensors() local
127 zero_point = builder->CreateVector( in ExportTensors()
128 std::vector<int64_t>{array.quantization_params->zero_point}); in ExportTensors()
131 scale, zero_point); in ExportTensors()
/external/tensorflow/tensorflow/contrib/lite/
Dmodel.cc640 quantization.zero_point = 0; in ParseTensors()
648 if (q_params->zero_point()) in ParseTensors()
649 quantization.zero_point = q_params->zero_point()->Get(0); in ParseTensors()
Dnnapi_delegate.cc93 zeroPoint = tensor->params.zero_point; in addTensorOperands()
102 zeroPoint = tensor->params.zero_point; in addTensorOperands()
/external/tensorflow/tensorflow/contrib/lite/toco/
Dtooling_util.h163 quantization_params->zero_point = 0;
212 quantization_params->zero_point = nudged_zero_point;
/external/tensorflow/tensorflow/contrib/lite/schema/
Dschema_v0.fbs28 // f = scale * (q - zero_point)
33 zero_point:[long];
Dschema_v2.fbs34 // f = scale * (q - zero_point)
39 zero_point:[long];
Dschema_v1.fbs33 // f = scale * (q - zero_point)
38 zero_point:[long];

12