Home
last modified time | relevance | path

Searched refs:min_range (Results 1 – 25 of 57) sorted by relevance

123

/external/tensorflow/tensorflow/core/kernels/
Dquantize_op.cc172 const float min_range = input_min_range.template flat<float>()(0); in Compute() local
174 QuantizeTensor(ctx, input, min_range, max_range, output, in Compute()
226 float min_range = std::min(0.0f, input_min_range); in QuantizeTensor() local
231 std::max(0.0f, std::max(input_max_range, min_range + epsilon)); in QuantizeTensor()
237 meta::Quantize(ctx, input_array.data(), input_array.size(), min_range, in QuantizeTensor()
241 ctx->template eigen_device<Device>(), input, min_range, max_range, in QuantizeTensor()
244 output_min_tensor->flat<float>()(0) = min_range; in QuantizeTensor()
263 float min_range = std::min(0.0f, input_min_range); in QuantizeSlice() local
268 std::max(0.0f, std::max(input_max_range, min_range + epsilon)); in QuantizeSlice()
274 (max_range - min_range); in QuantizeSlice()
[all …]
Dquantize_and_dequantize_op.h89 void ClampScaleAndRound(const Device& d, ConstVec input, T min_range, in ClampScaleAndRound() argument
92 output.device(d) = (input.cwiseMin(max_range).cwiseMax(min_range) * scale) in ClampScaleAndRound()
100 void ClampScaleAndRound(const Device& d, ConstVec input, T min_range, in ClampScaleAndRound() argument
105 ClampScaleAndRound(d, input, min_range, max_range, scale, inverse_scale, in ClampScaleAndRound()
110 ClampScaleAndRound(d, input, min_range, max_range, scale, inverse_scale, in ClampScaleAndRound()
145 T* min_range, T* max_range, T* scale, in ComputeQuantizationRange() argument
160 const T scale_from_min_side = (min_quantized * *min_range > 0) in ComputeQuantizationRange()
161 ? min_quantized / *min_range in ComputeQuantizationRange()
170 *inverse_scale = *min_range / min_quantized; in ComputeQuantizationRange()
175 *min_range = min_quantized * *inverse_scale; in ComputeQuantizationRange()
[all …]
Ddequantize_op.cc124 const float min_range = input_min_tensor.flat<float>()(0); in Compute() local
126 DequantizeTensor(ctx, input, min_range, max_range, &float_output); in Compute()
161 const float min_range, const float max_range, in DequantizeTensor() argument
172 (max_range - min_range) / in DequantizeTensor()
179 min_range; in DequantizeTensor()
185 min_range, max_range, output->flat<float>().data()); in DequantizeTensor()
188 ctx->template eigen_device<Device>(), input, min_range, max_range, in DequantizeTensor()
197 : std::max(min_range / min_output_value, in DequantizeTensor()
208 const ConstVec& input, float min_range, float max_range, in DequantizeSlice() argument
221 (max_range - min_range) / in DequantizeSlice()
[all …]
Ddequantize_op_test.cc43 float min_range, float max_range, in ComputeDequantizeMinCombinedUsingEigen() argument
52 (max_range - min_range) / in ComputeDequantizeMinCombinedUsingEigen()
59 min_range; in ComputeDequantizeMinCombinedUsingEigen()
65 void RunDequantizeMinCombinedTest(float min_range, float max_range, in RunDequantizeMinCombinedTest() argument
83 AddInputFromArray<float>(TensorShape({}), {min_range}); in RunDequantizeMinCombinedTest()
87 ComputeDequantizeMinCombinedUsingEigen<T>(GetInput(0), min_range, max_range, in RunDequantizeMinCombinedTest()
95 void RunDequantizeBfloat16MinCombinedTest(float min_range, float max_range) { in RunDequantizeBfloat16MinCombinedTest() argument
113 AddInputFromArray<float>(TensorShape({}), {min_range}); in RunDequantizeBfloat16MinCombinedTest()
118 ComputeDequantizeMinCombinedUsingEigen<T>(GetInput(0), min_range, max_range, in RunDequantizeBfloat16MinCombinedTest()
152 void RunDequantizeScaledTest(float min_range, float max_range, int axis, in RunDequantizeScaledTest() argument
[all …]
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/
Dquantize_and_dequantize_op.cc68 xla::XlaOp min_range, max_range; in Compile() local
70 min_range = ctx->Input(1); in Compile()
76 min_range = ReduceAll(input, xla::MaxValue(b, xla_type), *fmin); in Compile()
94 min_range = Reduce(input, xla::MaxValue(b, xla_type), *fmin, in Compile()
146 Select(Gt(min_quantized * min_range, zero), min_quantized / min_range, in Compile()
156 Select(cond, min_range / min_quantized, max_range / max_quantized); in Compile()
157 min_range = Select(cond, min_range, min_quantized * inverse_scale); in Compile()
162 xla::Shape axis_shape = b->GetShape(min_range).ValueOrDie(); in Compile()
171 min_range = convert_to_input_shape(min_range); in Compile()
184 input = Clamp(min_range, input, max_range); in Compile()
Ddequantize_op.cc68 xla::XlaOp min_range = xla::ConvertElementType(ctx->Input(1), xla::F32); in Compile() local
84 xla::XlaOp scale = (max_range - min_range) / full_range; in Compile()
86 output = xla::Add(xla::Mul(xla::Add(output, half_range), scale), min_range); in Compile()
/external/tensorflow/tensorflow/python/ops/
Ddequantize_op_test.py30 def _testDequantizeOp(self, inputs, min_range, max_range, dtype, argument
34 dequantized = array_ops.dequantize(input_op, min_range, max_range,
48 self.assertGreaterEqual(min_range, v_min)
58 (max_range - min_range) / type_range) + min_range
62 scale_factor = max(min_range / v_min, max_range / v_max)
116 min_range, max_range = -2.0, 1.6
119 min_range, max_range = [], []
121 min_range.append(-2.0 * (slice_idx + 1))
125 inputs, min_range, max_range, mode="SCALED", axis=axis))
130 inputs, min_range, max_range, mode="SCALED", axis=(axis - 4)))
Dquantized_ops_test.py74 min_range, max_range = -1.0, 0.8
77 min_range, max_range = [], []
79 min_range.append(-1.0 * (slice_idx + 1))
84 min_range,
95 min_range,
/external/tensorflow/tensorflow/core/api_def/base_api/
Dapi_def_QuantizeV2.pbtxt4 name: "min_range"
47 [min_range, max_range] are scalar floats that specify the range for
56 out[i] = (in[i] - min_range) * range(T) / (max_range - min_range)
65 output type is quint8 ([0, 255]). The min_range and max_range values should be
98 The scaling_factor is determined from `min_range` and `max_range` to be as large
99 as possible such that the range from `min_range` to `max_range` is representable
109 (min_T * min_range > 0) ? min_T / min_range : max_float;
117 We next use the scale_factor to adjust min_range and max_range as follows:
120 min_range = min_T / scale_factor;
125 e.g. if T = qint8, and initially min_range = -10, and max_range = 9, we would
[all …]
Dapi_def_Dequantize.pbtxt4 name: "min_range"
24 [min_range, max_range] are scalar floats that specify the range for
32 out[i] = min_range + (in[i]* (max_range - min_range) / range(T))
40 0-6. The min_range and max_range values are therefore 0.0 and 6.0.
60 The scaling_factor is determined from `min_range`, `max_range`, and
73 : std::max(min_range / min_expected_T,
/external/tensorflow/tensorflow/compiler/tf2tensorrt/convert/ops/
Dquantization_ops.cc46 T* min_range, T* max_range) { in ComputeQuantizationRange() argument
60 const T scale_from_min_side = (min_quantized * *min_range > 0) in ComputeQuantizationRange()
61 ? min_quantized / *min_range in ComputeQuantizationRange()
71 scales.dequantize_scale[0] = *min_range / min_quantized; in ComputeQuantizationRange()
76 *min_range = min_quantized * scales.dequantize_scale[0]; in ComputeQuantizationRange()
126 float min_range; member
150 args->min_range = inputs.at(1).weights().template GetPointer<float>()[0]; in ValidateQDQForExplicitPrecision()
154 /*signed_input=*/true, num_bits, args->narrow_range, &args->min_range, in ValidateQDQForExplicitPrecision()
210 << args.min_range << "/" << args.max_range; in ConvertExplicit()
318 float min_range = 0.0f; in ConvertDynamicRangeMode() local
[all …]
/external/tensorflow/tensorflow/security/advisory/
Dtfsa-2021-070.md19 min_range = tf.constant([-10], shape=[1], dtype=tf.float32)
23 input=input_tensor, min_range=min_range, max_range=max_range, mode='SCALED',
29 accesses the `min_range` and `max_range` tensors in parallel but fails to check
34 const float min_range = input_min_tensor.flat<float>()(0);
36 DequantizeTensor(ctx, input, min_range, max_range, &float_output);
Dtfsa-2021-138.md16 min_range=[1,2],
28 has some validation but does not check that `min_range` and `max_range` both
31 `input` tensor and then the lengths of `min_range` and `max_range` inputs match
/external/tensorflow/tensorflow/core/kernels/mkl/
Dmkl_quantize_op.cc267 void ComputeScalar(OpKernelContext* ctx, float min_range, float max_range) { in ComputeScalar() argument
301 scale_factor = (number_of_steps - 1.0) / (max_range - min_range); in ComputeScalar()
306 out_data[0] = (src_data[0] - min_range) * scale_factor; in ComputeScalar()
307 output_min_tensor->flat<float>()(0) = min_range; in ComputeScalar()
318 float min_range = std::min(0.0f, input_min_range); in Compute() local
336 max_range = std::max(input_max_range, min_range + epsilon); in Compute()
353 ComputeScalar(ctx, min_range, max_range); in Compute()
400 minfirst_input[i] = flat_input[i] - min_range; in Compute()
451 const float max_abs = std::max(std::abs(min_range), std::abs(max_range)); in Compute()
456 min_range = -max_abs; in Compute()
[all …]
Dmkl_dequantize_op.cc59 const float min_range = ctx->input(kMinIndex).template flat<float>()(0); in Compute() local
130 const float max_abs = std::max(std::abs(min_range), std::abs(max_range)); in Compute()
144 scale_factor = std::max(min_range / v_min, max_range / v_max); in Compute()
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/tests/
Dlower_quantized.mlir4 func.func @dequantize(%arg0: tensor<2x3x!tf_type.qint8>, %min_range: tensor<f32>, %max_range: tenso…
13 …%0 = "tf.Dequantize"(%arg0, %min_range, %max_range) : (tensor<2x3x!tf_type.qint8>, tensor<f32>, te…
20 func.func @dequantize_quint8(%arg0: tensor<2x3x!tf_type.quint8>, %min_range: tensor<f32>, %max_rang…
27 …%0 = "tf.Dequantize"(%arg0, %min_range, %max_range) : (tensor<2x3x!tf_type.quint8>, tensor<f32>, t…
34 func.func @dequantize_to_bf16(%arg0: tensor<2x3x!tf_type.qint8>, %min_range: tensor<f32>, %max_rang…
44 …%0 = "tf.Dequantize"(%arg0, %min_range, %max_range) : (tensor<2x3x!tf_type.qint8>, tensor<f32>, te…
/external/tensorflow/tensorflow/core/ops/compat/ops_history_v1/
DDequantize.pbtxt8 name: "min_range"
53 name: "min_range"
99 name: "min_range"
145 name: "min_range"
198 name: "min_range"
258 name: "min_range"
DQuantizeV2.pbtxt8 name: "min_range"
61 name: "min_range"
115 name: "min_range"
182 name: "min_range"
249 name: "min_range"
330 name: "min_range"
/external/tensorflow/tensorflow/core/ops/compat/ops_history_v2/
DDequantize.pbtxt8 name: "min_range"
53 name: "min_range"
99 name: "min_range"
145 name: "min_range"
DQuantizeV2.pbtxt8 name: "min_range"
61 name: "min_range"
115 name: "min_range"
182 name: "min_range"
249 name: "min_range"
/external/tensorflow/tensorflow/tools/api/golden/v2/
Dtensorflow.quantization.pbtxt5 …argspec: "args=[\'input\', \'min_range\', \'max_range\', \'mode\', \'name\', \'axis\', \'narrow_ra…
33 …argspec: "args=[\'input\', \'min_range\', \'max_range\', \'T\', \'mode\', \'round_mode\', \'name\'…
/external/tensorflow/tensorflow/tools/api/golden/v1/
Dtensorflow.quantization.pbtxt5 …argspec: "args=[\'input\', \'min_range\', \'max_range\', \'mode\', \'name\', \'axis\', \'narrow_ra…
33 …argspec: "args=[\'input\', \'min_range\', \'max_range\', \'T\', \'mode\', \'round_mode\', \'name\'…
/external/speex/tmv/
Dpreprocess_tm.h169 register int min_range, nb_adapt; in update_noise_prob() local
247 min_range = mux(nb_adapt < 100, 15, in update_noise_prob()
251 if ( st->min_count > min_range ) in update_noise_prob()
406 register int min_range; in update_noise_prob() local
445 min_range = mux(nb_adapt < 100, 15, in update_noise_prob()
450 if ( st->min_count > min_range ) in update_noise_prob()
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/transforms/
Dlower_tf.td165 $input, $min_range, $max_range,
176 (TF_SubOp $max_range, $min_range),
178 $min_range),
181 (TF_Float32Tensor $min_range),
/external/speex/libspeexdsp/
Dpreprocess.c663 int min_range; in update_noise_prob() local
679 min_range = 15; in update_noise_prob()
681 min_range = 50; in update_noise_prob()
683 min_range = 150; in update_noise_prob()
685 min_range = 300; in update_noise_prob()
686 if (st->min_count > min_range) in update_noise_prob()

123