Compute Library
 21.02
QuantizationInfo.h File Reference
#include "arm_compute/core/Rounding.h"
#include "utils/misc/Utility.h"
#include "arm_compute/core/Error.h"
#include <cstddef>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Data Structures

struct  UniformQuantizationInfo
 Quantization info when assuming per layer quantization. More...
 
class  QuantizationInfo
 Quantization information. More...
 
struct  Qasymm8QuantizationHelper< QUANTIZED_TYPE >
 

Namespaces

 arm_compute
 Copyright (c) 2017-2021 Arm Limited.
 

Typedefs

using qasymm8_signed_t = int8_t
 8 bit signed quantized asymmetric scalar value More...
 
using qasymm8_t = uint8_t
 8 bit quantized asymmetric scalar value More...
 
using qsymm16_t = int16_t
 16 bit quantized symmetric scalar value More...
 
using qasymm16_t = uint16_t
 16 bit quantized asymmetric scalar value More...
 

Functions

bool operator== (const QuantizationInfo &lhs, const QuantizationInfo &rhs)
 Check whether two quantization info are equal. More...
 
bool operator!= (const QuantizationInfo &lhs, const QuantizationInfo &rhs)
 Check whether two quantization info are not equal. More...
 
bool operator== (const UniformQuantizationInfo &lhs, const UniformQuantizationInfo &rhs)
 Check whether two quantization info are equal. More...
 
bool operator!= (const UniformQuantizationInfo &lhs, const UniformQuantizationInfo &rhs)
 Check whether two quantization info are not equal. More...
 
template<typename INFO_TYPE >
uint8_t quantize_qasymm8 (float value, const INFO_TYPE &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
 Quantize a value given an unsigned 8-bit asymmetric quantization scheme. More...
 
template<typename INFO_TYPE >
int8_t quantize_qasymm8_signed (float value, const INFO_TYPE &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
 Quantize a value given a signed 8-bit asymmetric quantization scheme. More...
 
int8_t quantize_qsymm8 (float value, const QuantizationInfo &qinfo)
 Quantize a value given a 8-bit symmetric quantization scheme. More...
 
int8_t quantize_qsymm8_per_channel (float value, const QuantizationInfo &qinfo, size_t channel_id=0)
 Quantize a value given a 8-bit symmetric per channel quantization scheme. More...
 
template<typename INFO_TYPE >
float dequantize_qasymm8 (uint8_t value, const INFO_TYPE &qinfo)
 Dequantize a value given an unsigned 8-bit asymmetric quantization scheme. More...
 
template<typename INFO_TYPE >
float dequantize_qasymm8_signed (int8_t value, const INFO_TYPE &qinfo)
 Dequantize a value given a signed 8-bit asymmetric quantization scheme. More...
 
float dequantize (uint8_t value, float scale, int32_t offset)
 Dequantize a value given an 8-bit asymmetric quantization scheme. More...
 
float dequantize_qsymm8 (int8_t value, const UniformQuantizationInfo &qinfo)
 Dequantize a value given a 8-bit symmetric quantization scheme. More...
 
float dequantize (int8_t value, float scale)
 Dequantize a value given a 8-bit symmetric quantization scheme. More...
 
float dequantize (int16_t value, float scale)
 Dequantize a value given a 16-bit symmetric quantization scheme. More...
 
float dequantize (uint16_t value, float scale, int32_t offset)
 Dequantize a value given a 16-bit asymmetric quantization scheme. More...
 
int16_t quantize_qsymm16 (float value, const UniformQuantizationInfo &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
 Quantize a value given a 16-bit symmetric quantization scheme. More...
 
float dequantize_qsymm16 (int16_t value, const UniformQuantizationInfo &qinfo)
 Dequantize a value given a 16-bit symmetric quantization scheme. More...
 
int16_t quantize_qsymm16 (float value, const QuantizationInfo &qinfo)
 Quantize a value given a 16-bit symmetric quantization scheme. More...
 
float dequantize_qsymm16 (int16_t value, const QuantizationInfo &qinfo)
 Dequantize a value given a 16-bit symmetric quantization scheme. More...
 
uint16_t quantize_qasymm16 (float value, const UniformQuantizationInfo &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
 Quantize a value given a 16-bit asymmetric quantization scheme. More...
 
float dequantize_qasymm16 (uint16_t value, const UniformQuantizationInfo &qinfo)
 Dequantize a value given a 16-bit asymmetric quantization scheme. More...
 
uint16_t quantize_qasymm16 (float value, const QuantizationInfo &qinfo)
 Quantize a value given a 16-bit asymmetric quantization scheme. More...
 
float dequantize_qasymm16 (uint16_t value, const QuantizationInfo &qinfo)
 Dequantize a value given a 16-bit asymmetric quantization scheme. More...
 
UniformQuantizationInfo compute_requantization_scale_offset (const UniformQuantizationInfo &uqinfo_in, const UniformQuantizationInfo &uqinfo_out)