Home
last modified time | relevance | path

Searched refs:quantization_params (Results 1 – 25 of 40) sorted by relevance

12

/external/tensorflow/tensorflow/lite/toco/graph_transformations/
Dquantization_util.cc79 const Array& array, QuantizationParams* quantization_params) { in ChooseQuantizationParamsForArrayAndQuantizedDataType() argument
80 *quantization_params = ::tflite::ChooseQuantizationParams<DataType<A>>( in ChooseQuantizationParamsForArrayAndQuantizedDataType()
86 QuantizationParams* quantization_params) { in ChooseQuantizationParamsForArrayAndQuantizedDataType() argument
90 ArrayDataType::kInt8>(array, quantization_params); in ChooseQuantizationParamsForArrayAndQuantizedDataType()
94 ArrayDataType::kUint8>(array, quantization_params); in ChooseQuantizationParamsForArrayAndQuantizedDataType()
98 ArrayDataType::kInt16>(array, quantization_params); in ChooseQuantizationParamsForArrayAndQuantizedDataType()
102 ArrayDataType::kUint16>(array, quantization_params); in ChooseQuantizationParamsForArrayAndQuantizedDataType()
106 ArrayDataType::kInt32>(array, quantization_params); in ChooseQuantizationParamsForArrayAndQuantizedDataType()
110 ArrayDataType::kUint32>(array, quantization_params); in ChooseQuantizationParamsForArrayAndQuantizedDataType()
114 ArrayDataType::kInt64>(array, quantization_params); in ChooseQuantizationParamsForArrayAndQuantizedDataType()
[all …]
Dquantize.cc227 QuantizationParams* quantization_params) { in ChooseQuantizationForOperatorInput() argument
268 if (!input_activations.quantization_params || in ChooseQuantizationForOperatorInput()
269 !input_weights.quantization_params) { in ChooseQuantizationForOperatorInput()
275 input_activations.quantization_params->scale; in ChooseQuantizationForOperatorInput()
276 const auto input_weights_scale = input_weights.quantization_params->scale; in ChooseQuantizationForOperatorInput()
277 quantization_params->scale = input_activations_scale * input_weights_scale; in ChooseQuantizationForOperatorInput()
278 quantization_params->zero_point = 0; in ChooseQuantizationForOperatorInput()
293 array, *quantized_data_type, quantization_params); in ChooseQuantizationForOperatorInput()
300 array, *quantized_data_type, quantization_params); in ChooseQuantizationForOperatorInput()
305 ArrayDataTypeName(array.final_data_type), quantization_params->zero_point, in ChooseQuantizationForOperatorInput()
[all …]
Dpropagate_fake_quant_num_bits.cc37 if (array->minmax && array->quantization_params && data_type_changed) { in ChangeArrayDataType()
54 double min = (old_quantized_min - array->quantization_params->zero_point) * in ChangeArrayDataType()
55 array->quantization_params->scale; in ChangeArrayDataType()
57 (old_quantized_max + 1 - array->quantization_params->zero_point) * in ChangeArrayDataType()
58 array->quantization_params->scale; in ChangeArrayDataType()
69 *array, new_data_type, array->quantization_params.get()); in ChangeArrayDataType()
77 if (!array->quantization_params && !array->minmax && new_minmax) { in ChangeArrayDataType()
Ddequantize.cc57 CHECK(array->quantization_params); in ClearArrayQuantizationParams()
60 auto& qparams = *array->quantization_params; in ClearArrayQuantizationParams()
75 array->quantization_params = nullptr; in ClearArrayQuantizationParams()
81 if (!array->quantization_params) { in DequantizeArray()
204 input_array.quantization_params = nullptr; in Run()
207 output_array.quantization_params = nullptr; in Run()
Didentify_nearest_upsample.cc217 if (output_array.quantization_params) { in Run()
219 output_array.quantization_params->scale; in Run()
221 output_array.quantization_params->zero_point; in Run()
247 if (output_array.quantization_params) { in Run()
249 output_array.quantization_params->scale; in Run()
251 output_array.quantization_params->zero_point; in Run()
Dquantization_util.h45 QuantizationParams* quantization_params);
51 const QuantizationParams& quantization_params);
Dshuffle_fc_weights.cc49 !input_array.quantization_params || !weights_array.quantization_params || in Run()
50 !output_array.quantization_params) { in Run()
Dunfuse_activation_functions.cc73 if (output_array.quantization_params) { in Run()
/external/tensorflow/tensorflow/lite/toco/graph_transformations/tests/
Dunpack_quantize_test.cc127 EXPECT_THAT(unpack_input_array.quantization_params->zero_point, in TEST_F()
128 unpack_array0.quantization_params->zero_point); in TEST_F()
129 EXPECT_THAT(unpack_input_array.quantization_params->scale, in TEST_F()
130 unpack_array0.quantization_params->scale); in TEST_F()
135 EXPECT_THAT(unpack_input_array.quantization_params->zero_point, in TEST_F()
136 unpack_array1.quantization_params->zero_point); in TEST_F()
137 EXPECT_THAT(unpack_input_array.quantization_params->scale, in TEST_F()
138 unpack_array1.quantization_params->scale); in TEST_F()
/external/tensorflow/tensorflow/lite/kernels/internal/
Dquantization_util.h45 QuantizationParams quantization_params; in ChooseQuantizationParams() local
46 quantization_params.zero_point = 0; in ChooseQuantizationParams()
47 quantization_params.scale = 0.; in ChooseQuantizationParams()
48 return quantization_params; in ChooseQuantizationParams()
95 QuantizationParams quantization_params; in ChooseQuantizationParams() local
96 quantization_params.zero_point = nudged_zero_point; in ChooseQuantizationParams()
97 quantization_params.scale = scale; in ChooseQuantizationParams()
98 return quantization_params; in ChooseQuantizationParams()
/external/tensorflow/tensorflow/lite/tools/optimize/
Dquantization_utils.cc63 QuantizationParametersT* quantization_params) { in GetAsymmetricQuantizationParams() argument
83 quantization_params->min = std::vector<float>(1, min); in GetAsymmetricQuantizationParams()
84 quantization_params->max = std::vector<float>(1, max); in GetAsymmetricQuantizationParams()
85 quantization_params->scale = std::vector<float>(1, scale); in GetAsymmetricQuantizationParams()
86 quantization_params->zero_point = std::vector<int64_t>(1, zero_point); in GetAsymmetricQuantizationParams()
91 QuantizationParametersT* quantization_params) { in GetSymmetricQuantizationParams() argument
96 quantization_params->min = std::vector<float>(1, min); in GetSymmetricQuantizationParams()
97 quantization_params->max = std::vector<float>(1, max); in GetSymmetricQuantizationParams()
98 quantization_params->scale = std::vector<float>(1, scale); in GetSymmetricQuantizationParams()
99 quantization_params->zero_point = std::vector<int64_t>(1, 0); in GetSymmetricQuantizationParams()
[all …]
Dquantization_utils.h37 QuantizationParametersT* quantization_params);
41 QuantizationParametersT* quantization_params);
47 QuantizationParametersT* quantization_params,
151 QuantizationParametersT* quantization_params,
Dquantization_utils_test.cc296 QuantizationParametersT quantization_params = QuantizationParametersT(); in TEST_F() local
303 &quantization_params, &error_reporter_); in TEST_F()
305 EXPECT_EQ(quantization_params.min, expected_mins); in TEST_F()
306 EXPECT_EQ(quantization_params.max, expected_maxs); in TEST_F()
307 EXPECT_EQ(quantization_params.quantized_dimension, channel_dim_idx); in TEST_F()
318 QuantizationParametersT quantization_params = QuantizationParametersT(); in TEST_F() local
325 &quantization_params, &error_reporter_); in TEST_F()
327 EXPECT_EQ(quantization_params.min, expected_mins); in TEST_F()
328 EXPECT_EQ(quantization_params.max, expected_maxs); in TEST_F()
329 EXPECT_EQ(quantization_params.quantized_dimension, channel_dim_idx); in TEST_F()
[all …]
/external/tensorflow/tensorflow/lite/micro/kernels/
Dquantize_common.cc39 data->quantization_params, tflite::micro::GetTensorShape(input), in EvalQuantizeReference()
46 data->quantization_params, tflite::micro::GetTensorShape(input), in EvalQuantizeReference()
53 data->quantization_params, tflite::micro::GetTensorShape(input), in EvalQuantizeReference()
71 data->input_zero_point, data->quantization_params.zero_point, in EvalQuantizeReference()
78 data->input_zero_point, data->quantization_params.zero_point, in EvalQuantizeReference()
85 data->input_zero_point, data->quantization_params.zero_point, in EvalQuantizeReference()
103 data->input_zero_point, data->quantization_params.zero_point, in EvalQuantizeReference()
Ddequantize.cc33 tflite::DequantizationParams quantization_params; member
73 data->quantization_params.zero_point = input->params.zero_point; in Prepare()
74 data->quantization_params.scale = static_cast<double>(input->params.scale); in Prepare()
89 reference_ops::Dequantize(data->quantization_params, in Eval()
96 reference_ops::Dequantize(data->quantization_params, in Eval()
103 reference_ops::Dequantize(data->quantization_params, in Eval()
123 data->quantization_params.zero_point, data->output_zero_point, in Eval()
Dquantize.cc75 data->quantization_params.zero_point = output->params.zero_point; in Prepare()
76 data->quantization_params.scale = static_cast<double>(output->params.scale); in Prepare()
Dquantize.h24 tflite::QuantizationParams quantization_params; member
/external/tensorflow/tensorflow/lite/micro/
Drecording_micro_allocator_test.cc216 const tflite::QuantizationParameters* quantization_params = in TF_LITE_MICRO_TEST() local
218 if (quantization_params && quantization_params->scale() && in TF_LITE_MICRO_TEST()
219 quantization_params->scale()->size() > 0 && in TF_LITE_MICRO_TEST()
220 quantization_params->zero_point() && in TF_LITE_MICRO_TEST()
221 quantization_params->zero_point()->size() > 0) { in TF_LITE_MICRO_TEST()
222 size_t num_channels = quantization_params->scale()->size(); in TF_LITE_MICRO_TEST()
/external/XNNPACK/test/
Dvadd-microkernel-tester.h172 xnn_qu8_add_params quantization_params = { }; variable
175 quantization_params = xnn_init_qu8_add_params(
181 quantization_params = xnn_init_scalar_qu8_add_params(
204 vadd_minmax(batch_size(), a_data, b_data, y.data(), &quantization_params);
243 xnn_qs8_add_params quantization_params = { }; variable
246 quantization_params = xnn_init_qs8_add_params(
252 quantization_params = xnn_init_scalar_qs8_add_params(
275 vadd_minmax(batch_size(), a_data, b_data, y.data(), &quantization_params);
Dgavgpool-microkernel-tester.h168 union xnn_qu8_avgpool_params quantization_params = { }; variable
171 quantization_params = xnn_init_qu8_avgpool_params(
177 quantization_params = xnn_init_scalar_qu8_avgpool_params(
207 &quantization_params);
243 union xnn_qu8_avgpool_params quantization_params = { }; variable
246 quantization_params = xnn_init_qu8_avgpool_params(
252 quantization_params = xnn_init_scalar_qu8_avgpool_params(
284 &quantization_params);
320 union xnn_qs8_avgpool_params quantization_params = { }; variable
323 quantization_params = xnn_init_qs8_avgpool_params(
[all …]
Dvaddc-microkernel-tester.h162 xnn_qs8_add_params quantization_params = { }; variable
165 quantization_params = xnn_init_qs8_add_params(
171 quantization_params = xnn_init_scalar_qs8_add_params(
194 vadd_minmax(batch_size(), a_data, &b, y.data(), &quantization_params);
Ddwconv-microkernel-tester.h240 union xnn_qu8_gemm_params quantization_params = { }; variable
243 quantization_params = xnn_init_qu8_gemm_params(
247 quantization_params = xnn_init_scalar_qu8_gemm_params(
268 &quantization_params);
353 union xnn_qs8_gemm_params quantization_params = { }; variable
356 quantization_params = xnn_init_qs8_gemm_params(
360 quantization_params = xnn_init_scalar_qs8_gemm_params(
381 &quantization_params);
Davgpool-microkernel-tester.h244 xnn_qu8_avgpool_params quantization_params = { }; variable
247 quantization_params = xnn_init_qu8_avgpool_params(
253 quantization_params = xnn_init_scalar_qu8_avgpool_params(
289 &quantization_params);
347 xnn_qu8_avgpool_params quantization_params = { }; variable
350 quantization_params = xnn_init_qu8_avgpool_params(
356 quantization_params = xnn_init_scalar_qu8_avgpool_params(
392 &quantization_params);
/external/tensorflow/tensorflow/lite/micro/kernels/xtensa/
Dquantize.cc140 op_data->input_zero_point, op_data->quantization_params.zero_point, in EvalXtensa()
156 int32_t zero_point = op_data->quantization_params.zero_point; in EvalXtensa()
197 op_data->quantization_params.zero_point = output->params.zero_point; in Prepare()
198 op_data->quantization_params.scale = in Prepare()
/external/tensorflow/tensorflow/lite/tools/serialization/
Dwriter_lib.cc202 flatbuffers::Offset<QuantizationParameters> quantization_params; in ExportTensors() local
214 quantization_params = CreateQuantizationParameters( in ExportTensors()
228 quantization_params = CreateQuantizationParameters( in ExportTensors()
242 quantization_params, tensor->is_variable)); in ExportTensors()

12