Home
last modified time | relevance | path

Searched refs:quantization (Results 1 – 25 of 155) sorted by relevance

1234567

/external/tensorflow/tensorflow/lite/tools/optimize/
Dsubgraph_quantizer.cc42 tensor->quantization = absl::make_unique<QuantizationParametersT>(); in AddQuantizationParams()
43 tensor->quantization->scale.assign(scales.begin(), scales.end()); in AddQuantizationParams()
47 tensor->quantization->zero_point.assign(zero_point.begin(), zero_point.end()); in AddQuantizationParams()
48 tensor->quantization->quantized_dimension = quantized_dimension; in AddQuantizationParams()
149 if (!input_tensor->quantization || in SymmetricPerChannelBiasQuantize()
150 input_tensor->quantization->scale.size() != 1) { in SymmetricPerChannelBiasQuantize()
154 TF_LITE_ENSURE(error_reporter, weight_tensor->quantization); in SymmetricPerChannelBiasQuantize()
155 const std::vector<float>& weight_scales = weight_tensor->quantization->scale; in SymmetricPerChannelBiasQuantize()
166 scales[i] = input_tensor->quantization->scale[0] * weight_scales[i]; in SymmetricPerChannelBiasQuantize()
206 if (!tensor->quantization || tensor->quantization->min.empty() || in AsymmetricQuantizeTensor()
[all …]
Dsubgraph_quantizer_test.cc95 ASSERT_TRUE(weights_tensor->quantization); in TEST()
97 ASSERT_TRUE(bias_tensor->quantization); in TEST()
98 ASSERT_TRUE(weights_tensor->quantization); in TEST()
99 const std::vector<float>& bias_scales = bias_tensor->quantization->scale; in TEST()
101 weights_tensor->quantization->scale; in TEST()
104 weights_tensor->quantization->zero_point; in TEST()
109 ASSERT_EQ(input_tensor->quantization->scale.size(), 1); in TEST()
110 ASSERT_EQ(output_tensor->quantization->scale.size(), 1); in TEST()
119 EXPECT_EQ(input_tensor->quantization->scale[0], 1); in TEST()
120 EXPECT_EQ(output_tensor->quantization->scale[0], 1); in TEST()
[all …]
Dquantization_utils.cc184 if (tensor->quantization == nullptr) { in SymmetricQuantizeTensor()
185 tensor->quantization = absl::make_unique<QuantizationParametersT>(); in SymmetricQuantizeTensor()
187 tensor->quantization->scale = std::vector<float>(1, scaling_factor); in SymmetricQuantizeTensor()
188 tensor->quantization->zero_point = std::vector<int64_t>(1, 0); in SymmetricQuantizeTensor()
/external/tensorflow/tensorflow/lite/toco/tflite/
Dimport.cc78 auto quantization = input_tensor->quantization(); in ImportTensors() local
79 if (quantization) { in ImportTensors()
82 if (quantization->min() && quantization->max()) { in ImportTensors()
83 CHECK_EQ(1, quantization->min()->Length()); in ImportTensors()
84 CHECK_EQ(1, quantization->max()->Length()); in ImportTensors()
86 minmax.min = quantization->min()->Get(0); in ImportTensors()
87 minmax.max = quantization->max()->Get(0); in ImportTensors()
89 if (quantization->scale() && quantization->zero_point()) { in ImportTensors()
90 CHECK_EQ(1, quantization->scale()->Length()); in ImportTensors()
91 CHECK_EQ(1, quantization->zero_point()->Length()); in ImportTensors()
[all …]
/external/tensorflow/tensorflow/lite/c/
Dc_api_internal.c94 void TfLiteQuantizationFree(TfLiteQuantization* quantization) { in TfLiteQuantizationFree() argument
95 if (quantization->type == kTfLiteAffineQuantization) { in TfLiteQuantizationFree()
97 (TfLiteAffineQuantization*)(quantization->params); in TfLiteQuantizationFree()
108 quantization->params = NULL; in TfLiteQuantizationFree()
109 quantization->type = kTfLiteNoQuantization; in TfLiteQuantizationFree()
117 TfLiteQuantizationFree(&t->quantization); in TfLiteTensorFree()
121 TfLiteQuantizationParams quantization, char* buffer, in TfLiteTensorReset() argument
129 tensor->params = quantization; in TfLiteTensorReset()
136 tensor->quantization.type = kTfLiteNoQuantization; in TfLiteTensorReset()
137 tensor->quantization.params = NULL; in TfLiteTensorReset()
/external/tensorflow/tensorflow/lite/
Dinterpreter.cc42 TfLiteQuantization quantization; in GetQuantizationFromLegacy() local
43 quantization.type = kTfLiteAffineQuantization; in GetQuantizationFromLegacy()
50 quantization.params = affine_quantization; in GetQuantizationFromLegacy()
52 return quantization; in GetQuantizationFromLegacy()
157 const std::vector<int>& dims, TfLiteQuantization quantization, in SetTensorParametersReadOnly() argument
160 tensor_index, type, name, dims.size(), dims.data(), quantization, buffer, in SetTensorParametersReadOnly()
166 const std::vector<int>& dims, TfLiteQuantization quantization, in SetTensorParametersReadWrite() argument
169 tensor_index, type, name, dims.size(), dims.data(), quantization, in SetTensorParametersReadWrite()
175 const int* dims, TfLiteQuantizationParams quantization, const char* buffer, in SetTensorParametersReadOnly() argument
177 TfLiteQuantization new_quantization = GetQuantizationFromLegacy(quantization); in SetTensorParametersReadOnly()
[all …]
Dinterpreter.h165 const std::vector<int>& dims, TfLiteQuantization quantization,
171 const std::vector<int>& dims, TfLiteQuantizationParams quantization,
175 dims.data(), quantization, buffer, bytes,
181 const int* dims, TfLiteQuantizationParams quantization,
191 TfLiteQuantization quantization,
197 const std::vector<int>& dims, TfLiteQuantizationParams quantization,
200 dims.data(), quantization, is_variable);
204 const int* dims, TfLiteQuantizationParams quantization,
Dmodel.cc304 TfLiteQuantization* quantization) { in ParseQuantization() argument
305 quantization->type = kTfLiteNoQuantization; in ParseQuantization()
328 quantization->type = kTfLiteAffineQuantization; in ParseQuantization()
348 quantization->params = reinterpret_cast<void*>(affine_quantization); in ParseQuantization()
370 const auto* src_quantization = tensor->quantization(); in ParseTensors()
371 TfLiteQuantization quantization; in ParseTensors() local
372 if (ParseQuantization(src_quantization, &quantization) != kTfLiteOk) { in ParseTensors()
421 i, type, get_name(tensor), dims, quantization, buffer_ptr, in ParseTensors()
429 dims, quantization, in ParseTensors()
/external/tensorflow/tensorflow/lite/kernels/
Dkernel_util_test.cc157 input.quantization.type = kTfLiteAffineQuantization; in TEST_F()
164 input.quantization.params = reinterpret_cast<void*>(input_params); in TEST_F()
177 filter.quantization.type = kTfLiteAffineQuantization; in TEST_F()
189 filter.quantization.params = reinterpret_cast<void*>(filter_params); in TEST_F()
198 bias.quantization.type = kTfLiteAffineQuantization; in TEST_F()
209 bias.quantization.params = reinterpret_cast<void*>(bias_params); in TEST_F()
218 output.quantization.type = kTfLiteAffineQuantization; in TEST_F()
225 output.quantization.params = reinterpret_cast<void*>(output_params); in TEST_F()
263 input.quantization.type = kTfLiteAffineQuantization; in TEST_F()
270 input.quantization.params = reinterpret_cast<void*>(input_params); in TEST_F()
[all …]
/external/tensorflow/tensorflow/lite/g3doc/performance/
Dmodel_optimization.md29 * Reduce representational precision with quantization.
32 We support quantization, and are working to add support for other techniques.
34 ## Model quantization
42 …mentations provide SIMD instruction capabilities, which are especially beneficial for quantization.
44 TensorFlow Lite provides several levels of support for quantization.
46 * [Post-training quantization](post_training_quantization.md) quantizes weights and activations pos…
51 Below are the latency and accuracy results for post-training quantization and
52 quantization-aware training on a few models. All latency numbers are measured on
77 <b>Table 1</b> Benefits of model quantization for select CNN models
81 ## Choice of quantization tool
[all …]
Dpost_training_quantization.md1 # Post-training quantization
3 Post-training quantization is a general technique to reduce model size while also
5 quantization quantizes weights from floating point to 8-bits of precision. This technique
37 If the accuracy drop is too high, consider using [quantization aware training](https://github.com/t…
58 With our post-training quantization tooling, we use symmetric quantization for
/external/tensorflow/tensorflow/contrib/quantize/
DREADME.md10 convolutional and fully-connected layers prior to quantization by
13 The quantization error is modeled using [fake quantization](../../api_guides/python/array_ops.md#Fa…
14 nodes to simulate the effect of quantization in the forward and backward passes. The
15 forward-pass models quantization, while the backward-pass models quantization as a
16 straight-through estimator. Both the forward- and backward-pass simulate the quantization
23 during training. This allows a model trained with quantization in the loop to be
27 Since it's difficult to add these fake quantization operations to all the
37 # often needed to fine tune a floating point model for quantization
39 # can be used to activate quantization after training to converge
51 since the quantization ops affect the batch normalization step. Because of this,
[all …]
/external/gemmlowp/doc/
Dpublic.md15 rationale for a specific quantization paradigm is given in
16 [quantization.md](quantization.md). That specific quantization paradigm is
97 quantization paradigm explained in [quantization.md](quantization.md) that
102 pipeline (see [output.md](output.md)). This is the part of the quantization
103 paradigm explained in [quantization.md](quantization.md) that needs to be
146 quantization", whence the PC suffix. This has been useful in some settings where
149 the need for per-channel quantization. For that reason, the long-term usefulness
155 section of [low-precision.md](low-precision.md) on the legacy quantization
Dquantization.md1 # Building a quantization paradigm from first principles
12 quantization paradigm affects the calculations that gemmlowp itself needs to
25 naturally at some specific quantization paradigm, and how that can be
28 We also aim to show how that differs from the older, legacy quantization
30 newer quantization paradigm described in this document was useful as far as some
75 ## The final form of the quantization equation
78 representable &mdash; means in either quantization equations, (1) and (2).
111 In other words, `D = -zero_point`. This suggests rewriting the quantization
122 With this quantization equation (3), the condition that 0 be exactly
148 above equation (3), with some already-known quantization parameters `lhs_scale`,
[all …]
Doutput.md10 quantization paradigms. See [low-precision.md](low-precision.md) and
11 [quantization.md](quantization.md).
13 Besides implementing a quantization paradigm, the other thing that output
51 quantized matrix multiplication with a sounds quantization paradigm, is here:
/external/tensorflow/tensorflow/contrib/quantization/python/
D__init__.py22 from tensorflow.contrib.quantization.python.array_ops import *
23 from tensorflow.contrib.quantization.python.math_ops import *
24 from tensorflow.contrib.quantization.python.nn_ops import *
/external/tensorflow/tensorflow/lite/testdata/
Dadd_quantized.json18 quantization: {
42 quantization: {
66 quantization: {
/external/tensorflow/tensorflow/contrib/quantization/
D__init__.py23 from tensorflow.contrib.quantization.python import array_ops as quantized_array_ops
24 from tensorflow.contrib.quantization.python.math_ops import *
25 from tensorflow.contrib.quantization.python.nn_ops import *
DREADME.md1 The contrib/quantization package exposes a few TensorFlow quantization operations.
/external/tensorflow/tensorflow/lite/core/
Dsubgraph.cc77 const TfLiteQuantization& quantization) { in GetLegacyQuantization() argument
84 if (quantization.type != kTfLiteAffineQuantization) { in GetLegacyQuantization()
89 reinterpret_cast<TfLiteAffineQuantization*>(quantization.params); in GetLegacyQuantization()
821 const int* dims, TfLiteQuantization quantization, const char* buffer, in SetTensorParametersReadOnly() argument
846 TfLiteQuantizationFree(&tensor.quantization); in SetTensorParametersReadOnly()
849 tensor.params = GetLegacyQuantization(quantization); in SetTensorParametersReadOnly()
850 tensor.quantization = quantization; in SetTensorParametersReadOnly()
856 GetLegacyQuantization(quantization), in SetTensorParametersReadOnly()
861 tensor.quantization = quantization; in SetTensorParametersReadOnly()
872 const int* dims, TfLiteQuantization quantization, bool is_variable) { in SetTensorParametersReadWrite() argument
[all …]
Dsubgraph.h90 const std::vector<int>& dims, TfLiteQuantization quantization,
94 dims.data(), quantization, buffer, bytes,
99 const int* dims, TfLiteQuantization quantization, const char* buffer,
108 const std::vector<int>& dims, TfLiteQuantization quantization,
111 dims.data(), quantization, is_variable);
116 TfLiteQuantization quantization,
/external/webp/src/enc/
Dpredictor_enc.c151 uint8_t boundary, int quantization) { in NearLosslessComponent() argument
154 const int lower = residual & ~(quantization - 1); in NearLosslessComponent()
155 const int upper = lower + quantization; in NearLosslessComponent()
165 return lower + (quantization >> 1); in NearLosslessComponent()
174 return lower + (quantization >> 1); in NearLosslessComponent()
192 int quantization; in NearLossless() local
199 quantization = max_quantization; in NearLossless()
200 while (quantization >= max_diff) { in NearLossless()
201 quantization >>= 1; in NearLossless()
207 a = NearLosslessComponent(value >> 24, predict >> 24, 0xff, quantization); in NearLossless()
[all …]
/external/libjpeg-turbo/
Dwizard.txt21 jcparam.c. At very low quality settings, some quantization table entries
22 can get scaled up to values exceeding 255. Although 2-byte quantization
26 quantization values to no more than 255 by giving the -baseline switch.
30 You can substitute a different set of quantization values by using the
33 -qtables file Use the quantization tables given in the named file.
35 The specified file should be a text file containing decimal quantization
44 duplicates the default quantization tables:
73 the quantization values are constrained to the range 1-255.
75 By default, cjpeg will use quantization table 0 for luminance components and
79 -qslots N[,...] Select which quantization table to use for
[all …]
/external/tensorflow/tensorflow/lite/g3doc/convert/
Dquantization.md26 ["fake-quantization" nodes](https://github.com/tensorflow/tensorflow/tree/r1.13/tensorflow/contrib/…
45 For most users, we recommend using post-training quantization. We are working on
46 new tools for post-training and during training quantization that we hope will
/external/tensorflow/tensorflow/lite/toco/
Dtoco_flags.proto49 // quantization of input arrays, separately from other arrays.
61 // the uint8 values are interpreted as real numbers, and the quantization
67 // the representation (quantization) of real numbers in the output file,
75 // file to choose a different real-numbers representation (quantization)
92 // with quantization of models. Normally, quantization requires the input
100 // allowing for quantization to proceed.
116 // generate plain float code without fake-quantization from a quantized

1234567