Home
last modified time | relevance | path

Searched refs:scales (Results 1 – 25 of 193) sorted by relevance

12345678

/external/libtextclassifier/native/annotator/
Dquantization_test.cc40 std::vector<float> scales{{0.1, 9.0, -7.0}}; in TEST() local
51 DequantizeAdd(scales.data(), embeddings.data(), bytes_per_embedding, in TEST()
69 DequantizeAdd(scales.data(), embeddings.data(), bytes_per_embedding, in TEST()
92 std::vector<float> scales(num_buckets); in TEST() local
94 std::fill(scales.begin(), scales.end(), 1); in TEST()
98 DequantizeAdd(scales.data(), embeddings.data(), bytes_per_embedding, in TEST()
115 std::vector<float> scales(num_buckets, 1.0); in TEST() local
119 DequantizeAdd(scales.data(), embeddings.data(), bytes_per_embedding, in TEST()
135 std::vector<float> scales(num_buckets, 1.0); in TEST() local
136 scales[1] = 9.0; in TEST()
[all …]
Dquantization.cc28 void DequantizeAdd8bit(const float* scales, const uint8* embeddings, in DequantizeAdd8bit() argument
32 const float multiplier = scales[bucket_id]; in DequantizeAdd8bit()
40 void DequantizeAddNBit(const float* scales, const uint8* embeddings, in DequantizeAddNBit() argument
45 const float multiplier = scales[bucket_id]; in DequantizeAddNBit()
73 bool DequantizeAdd(const float* scales, const uint8* embeddings, in DequantizeAdd() argument
78 DequantizeAdd8bit(scales, embeddings, bytes_per_embedding, in DequantizeAdd()
81 DequantizeAddNBit(scales, embeddings, bytes_per_embedding, in DequantizeAdd()
Dmodel-executor.cc71 const TfLiteTensor* scales = interpreter->tensor(1); in FromBuffer() local
72 if (scales->dims->size != 2 || scales->dims->data[0] != num_buckets || in FromBuffer()
73 scales->dims->data[1] != 1) { in FromBuffer()
85 embedding_size, scales, embeddings, std::move(interpreter), in FromBuffer()
92 const TfLiteTensor* scales, const TfLiteTensor* embeddings, in TFLiteEmbeddingExecutor() argument
100 scales_(scales), in TFLiteEmbeddingExecutor()
/external/tensorflow/tensorflow/lite/micro/kernels/
Dadd_test.cc226 const float scales[] = {0.25, 0.5, 1.0}; in TF_LITE_MICRO_TEST() local
240 inout_shape, input1_values, input1_quantized, scales[0], zero_points[0], in TF_LITE_MICRO_TEST()
241 inout_shape, input2_values, input2_quantized, scales[1], zero_points[1], in TF_LITE_MICRO_TEST()
242 inout_shape, golden_values, golden_quantized, scales[2], zero_points[2], in TF_LITE_MICRO_TEST()
247 const float scales[] = {0.25, 0.5, 1.0}; in TF_LITE_MICRO_TEST() local
261 inout_shape, input1_values, input1_quantized, scales[0], zero_points[0], in TF_LITE_MICRO_TEST()
262 inout_shape, input2_values, input2_quantized, scales[1], zero_points[1], in TF_LITE_MICRO_TEST()
263 inout_shape, golden_values, golden_quantized, scales[2], zero_points[2], in TF_LITE_MICRO_TEST()
268 const float scales[] = {0.25, 0.5, 1.0}; in TF_LITE_MICRO_TEST() local
282 inout_shape, input1_values, input1_quantized, scales[0], zero_points[0], in TF_LITE_MICRO_TEST()
[all …]
Dsub_test.cc225 const float scales[] = {0.25, 0.5, 1.0}; in TF_LITE_MICRO_TEST() local
239 inout_shape, input1_values, input1_quantized, scales[0], zero_points[0], in TF_LITE_MICRO_TEST()
240 inout_shape, input2_values, input2_quantized, scales[1], zero_points[1], in TF_LITE_MICRO_TEST()
241 inout_shape, golden_values, golden_quantized, scales[2], zero_points[2], in TF_LITE_MICRO_TEST()
246 const float scales[] = {0.25, 0.5, 1.0}; in TF_LITE_MICRO_TEST() local
260 inout_shape, input1_values, input1_quantized, scales[0], zero_points[0], in TF_LITE_MICRO_TEST()
261 inout_shape, input2_values, input2_quantized, scales[1], zero_points[1], in TF_LITE_MICRO_TEST()
262 inout_shape, golden_values, golden_quantized, scales[2], zero_points[2], in TF_LITE_MICRO_TEST()
267 const float scales[] = {0.25, 0.5, 1.0}; in TF_LITE_MICRO_TEST() local
281 inout_shape, input1_values, input1_quantized, scales[0], zero_points[0], in TF_LITE_MICRO_TEST()
[all …]
/external/tensorflow/tensorflow/lite/kernels/internal/
Dper_channel_dequantize_test.cc30 const std::vector<float> scales = {0.5, 0.25}; in TEST() local
42 op_params.scale = scales.data(); in TEST()
52 const std::vector<float> scales = {0.5, 0.25, 0.5, 0.25, 1.0}; in TEST() local
64 op_params.scale = scales.data(); in TEST()
74 const std::vector<float> scales = {0.5, 0.25}; in TEST() local
87 op_params.scale = scales.data(); in TEST()
98 const std::vector<float> scales = {0.5, 0.25, 0.5, 0.25, 1.0}; in TEST() local
111 op_params.scale = scales.data(); in TEST()
/external/tensorflow/tensorflow/lite/testing/op_tests/
Dnearest_upsample.py37 def new_shape_for_upsample(original_shape, scales, axis): argument
46 if j < len(scales) and axis[j] == i:
48 ones_new_shape.append(scales[j])
49 upsample_new_shape.append(original_shape[i] * scales[j])
60 scales, axis = parameters["scale_n_axis"]
62 input_shape, scales, axis)
/external/llvm-project/mlir/lib/Dialect/Quant/IR/
DTypeDetail.h163 ArrayRef<double> scales, ArrayRef<int64_t> zeroPoints, in KeyTy()
167 scales(scales), zeroPoints(zeroPoints), in KeyTy()
179 ArrayRef<double> scales; member
185 ArrayRef<double> getScales() const { return scales; } in getScales()
207 int64_t *scalesCast = llvm::bit_cast<int64_t *>(scales.data()); in getHashValue()
208 ArrayRef<int64_t> scalesBits(scalesCast, scales.size()); in getHashValue()
219 UniformQuantizedPerAxisTypeStorage(const KeyTy &key, ArrayRef<double> scales, in UniformQuantizedPerAxisTypeStorage()
223 scaleElements(scales.data()), zeroPointElements(zeroPoints.data()), in UniformQuantizedPerAxisTypeStorage()
224 quantParamsSize(scales.size()), in UniformQuantizedPerAxisTypeStorage()
234 ArrayRef<double> scales = allocator.copyInto(key.scales); in construct() local
[all …]
DTypeParser.cpp202 SmallVector<double, 1> scales; in parseUniformType() local
254 scales.resize(scales.size() + 1); in parseUniformType()
256 if (parseQuantParams(parser, scales.back(), zeroPoints.back())) { in parseUniformType()
271 if (!isPerAxis && scales.size() > 1) { in parseUniformType()
279 ArrayRef<double> scalesRef(scales.begin(), scales.end()); in parseUniformType()
287 scales.front(), zeroPoints.front(), in parseUniformType()
403 ArrayRef<double> scales = type.getScales(); in printUniformQuantizedPerAxisType() local
407 llvm::seq<size_t>(0, scales.size()), out, in printUniformQuantizedPerAxisType()
409 printQuantParams(scales[index], zeroPoints[index], out); in printUniformQuantizedPerAxisType()
DQuantTypes.cpp292 ArrayRef<double> scales, ArrayRef<int64_t> zeroPoints, in get() argument
296 scales, zeroPoints, quantizedDimension, storageTypeMin, in get()
302 ArrayRef<double> scales, ArrayRef<int64_t> zeroPoints, in getChecked() argument
305 return Base::getChecked(location, flags, storageType, expressedType, scales, in getChecked()
312 ArrayRef<double> scales, ArrayRef<int64_t> zeroPoints, in verifyConstructionInvariants() argument
333 if (scales.size() != zeroPoints.size()) in verifyConstructionInvariants()
335 << scales.size() << ", " << zeroPoints.size(); in verifyConstructionInvariants()
338 for (double scale : scales) { in verifyConstructionInvariants()
/external/tensorflow/tensorflow/lite/tools/optimize/
Dquantization_utils.cc194 std::vector<float>* scales, in GetSymmetricScalesFromMaxMin() argument
207 if (scales->size() != quant_params->min.size()) { in GetSymmetricScalesFromMaxMin()
220 scales->at(channel_idx) = half_range / kMaxQuantizedValue; in GetSymmetricScalesFromMaxMin()
363 std::vector<float> scales(1, scaling_factor); in SymmetricQuantizeFloatsToInt16() local
365 return AddQuantizationParams(scales, zero_points, 0, uint8_buffer, in SymmetricQuantizeFloatsToInt16()
531 TfLiteStatus AddQuantizationParams(const std::vector<float>& scales, in AddQuantizationParams() argument
541 tensor->quantization->scale.assign(scales.begin(), scales.end()); in AddQuantizationParams()
542 if (zero_point.size() != scales.size()) { in AddQuantizationParams()
547 zero_point.size(), scales.size()); in AddQuantizationParams()
582 std::vector<float> scales(channel_dim_size); in SymmetricQuantizeTensorPerChannel() local
[all …]
/external/tensorflow/tensorflow/compiler/mlir/lite/quantization/
Dquantization_utils.cc130 ArrayRef<double> scales = qtype.getScales(); in RescaleQuantizedType() local
132 if (static_cast<int64_t>(scales.size()) != factor_values.getNumElements()) in RescaleQuantizedType()
135 new_scales.reserve(scales.size()); in RescaleQuantizedType()
136 auto scales_iter = scales.begin(); in RescaleQuantizedType()
212 SmallVector<double, 4> scales(qtype.getScales().begin(), in ResetAxisAndBroadcast() local
229 if (BroadcastVector<double>(shaped.getDimSize(quant_dim), scales) || in ResetAxisAndBroadcast()
247 scales, zero_points, quant_dim, qtype.getStorageTypeMin(), in ResetAxisAndBroadcast()
408 llvm::SmallVector<double, 4> scales(axis_size, 1.0); in GetUniformQuantizedTypeForBias() local
412 scales[index_scale.index()] *= index_scale.value(); in GetUniformQuantizedTypeForBias()
416 scales[index] *= type.getScale(); in GetUniformQuantizedTypeForBias()
[all …]
/external/tensorflow/tensorflow/lite/micro/kernels/arc_mli/
Dconv_slicing_test.cc294 float scales[tflite::testing::kBias1Elements + 1]; in TF_LITE_MICRO_TEST() local
301 tflite::testing::kBias1Data, bias_quantized, scales, zero_points, in TF_LITE_MICRO_TEST()
323 float scales[tflite::testing::kBias1Elements + 1]; in TF_LITE_MICRO_TEST() local
330 tflite::testing::kBias1Data, bias_quantized, scales, zero_points, in TF_LITE_MICRO_TEST()
351 float scales[tflite::testing::kBias2Elements + 1]; in TF_LITE_MICRO_TEST() local
358 tflite::testing::kBias2Data, bias_quantized, scales, zero_points, in TF_LITE_MICRO_TEST()
380 float scales[tflite::testing::kBias2Elements + 1]; in TF_LITE_MICRO_TEST() local
387 tflite::testing::kBias2Data, bias_quantized, scales, zero_points, in TF_LITE_MICRO_TEST()
408 float scales[tflite::testing::kBias3Elements + 1]; in TF_LITE_MICRO_TEST() local
415 tflite::testing::kBias3Data, bias_quantized, scales, zero_points, in TF_LITE_MICRO_TEST()
[all …]
/external/dng_sdk/source/
Ddng_misc_opcodes.cpp1277 uint32 scales = SafeUint32DivideUp (fAreaSpec.Area ().H (), in dng_opcode_ScalePerRow() local
1280 if (scales != stream.Get_uint32 ()) in dng_opcode_ScalePerRow()
1285 if (dataSize != dng_area_spec::kDataSize + 4 + scales * 4) in dng_opcode_ScalePerRow()
1290 fTable.Reset (host.Allocate (SafeUint32Mult (scales, in dng_opcode_ScalePerRow()
1295 for (uint32 j = 0; j < scales; j++) in dng_opcode_ScalePerRow()
1305 printf ("Count: %u\n", (unsigned) scales); in dng_opcode_ScalePerRow()
1307 for (uint32 k = 0; k < scales && k < gDumpLineLimit; k++) in dng_opcode_ScalePerRow()
1312 if (scales > gDumpLineLimit) in dng_opcode_ScalePerRow()
1314 printf (" ... %u scales skipped\n", (unsigned) (scales - gDumpLineLimit)); in dng_opcode_ScalePerRow()
1328 uint32 scales = SafeUint32DivideUp (fAreaSpec.Area ().H (), in PutData() local
[all …]
/external/tensorflow/tensorflow/lite/micro/
Dtesting_helpers_test.cc50 float scales[channels + 1]; in TF_LITE_MICRO_TEST() local
59 pre_quantized, quantized, dims, input_scale, weight_scales, scales, in TF_LITE_MICRO_TEST()
65 TF_LITE_MICRO_EXPECT_EQ(scales[i + 1], input_scale * weight_scales[i]); in TF_LITE_MICRO_TEST()
88 float scales[channels + 1]; in TF_LITE_MICRO_TEST() local
92 pre_quantized, quantized, dims, scales, zero_points, &quant, 0); in TF_LITE_MICRO_TEST()
/external/skqp/src/gpu/gradients/
DGrUnrolledBinaryGradientColorizer.fp137 // The raster implementation also uses scales and biases, but since they must be calculated
139 SkPMColor4f scales[kMaxIntervals];
168 scale.store(scales + intervalCount);
176 scales[i] = SK_PMColor4fTRANSPARENT;
182 intervalCount, scales[0], scales[1], scales[2], scales[3], scales[4], scales[5],
183 scales[6], scales[7], biases[0], biases[1], biases[2], biases[3], biases[4],
DGrUnrolledBinaryGradientColorizer.cpp332 SkPMColor4f scales[kMaxIntervals]; in Make() local
361 scale.store(scales + intervalCount); in Make()
369 scales[i] = SK_PMColor4fTRANSPARENT; in Make()
375 intervalCount, scales[0], scales[1], scales[2], scales[3], scales[4], scales[5], in Make()
376 scales[6], scales[7], biases[0], biases[1], biases[2], biases[3], biases[4], biases[5], in Make()
/external/skia/tests/
DMatrixTest.cpp179 SkScalar scales[2]; in test_matrix_min_max_scale() local
186 success = identity.getMinMaxScales(scales); in test_matrix_min_max_scale()
187 REPORTER_ASSERT(reporter, success && 1 == scales[0] && 1 == scales[1]); in test_matrix_min_max_scale()
193 success = scale.getMinMaxScales(scales); in test_matrix_min_max_scale()
194 REPORTER_ASSERT(reporter, success && 2 == scales[0] && 4 == scales[1]); in test_matrix_min_max_scale()
200 success = rot90Scale.getMinMaxScales(scales); in test_matrix_min_max_scale()
201 … REPORTER_ASSERT(reporter, success && SK_Scalar1 / 4 == scales[0] && SK_Scalar1 / 2 == scales[1]); in test_matrix_min_max_scale()
207 success = rotate.getMinMaxScales(scales); in test_matrix_min_max_scale()
209 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(1, scales[0], SK_ScalarNearlyZero)); in test_matrix_min_max_scale()
210 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(1, scales[1], SK_ScalarNearlyZero)); in test_matrix_min_max_scale()
[all …]
/external/skqp/gm/
Dimagefiltersscaled.cpp118 SkVector scales[] = { in onDraw() local
131 for (size_t j = 0; j < SK_ARRAY_COUNT(scales); ++j) { in onDraw()
139 canvas->scale(scales[j].fX, scales[j].fY); in onDraw()
149 canvas->translate(r.width() * scales[j].fX + margin, 0); in onDraw()
152 canvas->translate(0, r.height() * scales[j].fY + margin); in onDraw()
Dblurrect.cpp116 SkScalar scales[] = { SK_Scalar1, 0.6f }; in onDraw() local
118 for (size_t s = 0; s < SK_ARRAY_COUNT(scales); ++s) { in onDraw()
133 canvas->scale(scales[s], scales[s]); in onDraw()
143 canvas->translate(0, SK_ARRAY_COUNT(procs) * r.height() * 4/3 * scales[s]); in onDraw()
146 canvas->translate(4 * r.width() * 4/3 * scales[s], 0); in onDraw()
/external/skia/gm/
Dimagefiltersscaled.cpp114 SkVector scales[] = { in onDraw() local
127 for (size_t j = 0; j < SK_ARRAY_COUNT(scales); ++j) { in onDraw()
135 canvas->scale(scales[j].fX, scales[j].fY); in onDraw()
145 canvas->translate(r.width() * scales[j].fX + margin, 0); in onDraw()
148 canvas->translate(0, r.height() * scales[j].fY + margin); in onDraw()
/external/skia/src/gpu/gradients/
DGrUnrolledBinaryGradientColorizer.fp137 // The raster implementation also uses scales and biases, but since they must be calculated
139 SkPMColor4f scales[kMaxIntervals];
168 scale.store(scales + intervalCount);
176 scales[i] = SK_PMColor4fTRANSPARENT;
182 intervalCount, scales[0], scales[1], scales[2], scales[3], scales[4], scales[5],
183 scales[6], scales[7], biases[0], biases[1], biases[2], biases[3], biases[4],
/external/skqp/tests/
DMatrixTest.cpp169 SkScalar scales[2]; in test_matrix_min_max_scale() local
176 success = identity.getMinMaxScales(scales); in test_matrix_min_max_scale()
177 REPORTER_ASSERT(reporter, success && SK_Scalar1 == scales[0] && SK_Scalar1 == scales[1]); in test_matrix_min_max_scale()
183 success = scale.getMinMaxScales(scales); in test_matrix_min_max_scale()
184 … REPORTER_ASSERT(reporter, success && SK_Scalar1 * 2 == scales[0] && SK_Scalar1 * 4 == scales[1]); in test_matrix_min_max_scale()
191 success = rot90Scale.getMinMaxScales(scales); in test_matrix_min_max_scale()
192 … REPORTER_ASSERT(reporter, success && SK_Scalar1 / 4 == scales[0] && SK_Scalar1 / 2 == scales[1]); in test_matrix_min_max_scale()
198 success = rotate.getMinMaxScales(scales); in test_matrix_min_max_scale()
200 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(SK_Scalar1, scales[0], SK_ScalarNearlyZero)); in test_matrix_min_max_scale()
201 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(SK_Scalar1, scales[1], SK_ScalarNearlyZero)); in test_matrix_min_max_scale()
[all …]
/external/llvm-project/mlir/lib/Dialect/Quant/Utils/
DFakeQuantSupport.cpp160 SmallVector<double, 4> scales; in fakeQuantAttrsToType() local
162 scales.reserve(axis_size); in fakeQuantAttrsToType()
168 scales.push_back(1.0); in fakeQuantAttrsToType()
176 scales.push_back(scale); in fakeQuantAttrsToType()
182 flags, storageType, expressedType, scales, zeroPoints, quantizedDimension, in fakeQuantAttrsToType()
/external/skia/src/gpu/gradients/generated/
DGrUnrolledBinaryGradientColorizer.cpp459 SkPMColor4f scales[kMaxIntervals]; in Make() local
488 scale.store(scales + intervalCount); in Make()
496 scales[i] = SK_PMColor4fTRANSPARENT; in Make()
503 scales[0], in Make()
504 scales[1], in Make()
505 scales[2], in Make()
506 scales[3], in Make()
507 scales[4], in Make()
508 scales[5], in Make()
509 scales[6], in Make()
[all …]

12345678