MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / quantize_qsymm8

Function quantize_qsymm8

arm_compute/core/QuantizationInfo.h:399–404  ·  view source on GitHub ↗

Quantize a value given a 8-bit symmetric quantization scheme * * @param[in] value Value to quantize * @param[in] qinfo Quantization information to use for quantizing * * @return Quantized value */

Source from the content-addressed store, hash-verified

397 * @return Quantized value
398 */
399inline int8_t quantize_qsymm8(float value, const QuantizationInfo &qinfo)
400{
401 int quantized = arm_compute::round(value / qinfo.uniform().scale, RoundingPolicy::TO_NEAREST_UP);
402 quantized = std::max(-128, std::min(quantized, 127));
403 return quantized;
404}
405
406/** Quantize a value given a 8-bit symmetric per channel quantization scheme
407 *

Callers 2

PixelValueMethod · 0.85
run_quantize_qsymm8Function · 0.85

Calls 2

roundFunction · 0.50
uniformMethod · 0.45

Tested by

no test coverage detected