Compute Library
 20.02.1
QuantizationInfo Class Reference

Quantization information. More...

#include <QuantizationInfo.h>

Public Member Functions

 QuantizationInfo () noexcept
 Default constructor. More...
 
 QuantizationInfo (float scale)
 Construct quantization info. More...
 
 QuantizationInfo (float scale, int offset)
 Construct quantization info. More...
 
 QuantizationInfo (std::vector< float > scale)
 Construct quantization info. More...
 
 QuantizationInfo (std::vector< float > scale, std::vector< int32_t > offset)
 Construct quantization info. More...
 
const std::vector< float > & scale () const
 Scale vector accessor. More...
 
const std::vector< int32_t > & offset () const
 Offset vector accessor. More...
 
bool empty () const
 Indicates whether this QuantizationInfo has valid settings or not. More...
 
UniformQuantizationInfo uniform () const
 Return per layer quantization info. More...
 

Detailed Description

Quantization information.

Definition at line 69 of file QuantizationInfo.h.

Constructor & Destructor Documentation

◆ QuantizationInfo() [1/5]

QuantizationInfo ( )
inlinenoexcept

Default constructor.

Definition at line 73 of file QuantizationInfo.h.

74  : _scale(),
75  _offset()
76  {
77  }

◆ QuantizationInfo() [2/5]

QuantizationInfo ( float  scale)
inline

Construct quantization info.

Note
Used for symmetric quantization
Parameters
[in]scaleScale.

Definition at line 84 of file QuantizationInfo.h.

85  : _scale(1, scale), _offset()
86  {
87  }
const std::vector< float > & scale() const
Scale vector accessor.

◆ QuantizationInfo() [3/5]

QuantizationInfo ( float  scale,
int  offset 
)
inline

Construct quantization info.

Note
Used for asymmetric quantization
Parameters
[in]scaleScale.
[in]offsetOffset.

Definition at line 95 of file QuantizationInfo.h.

96  : _scale(1, scale), _offset(1, offset)
97  {
98  }
const std::vector< int32_t > & offset() const
Offset vector accessor.
const std::vector< float > & scale() const
Scale vector accessor.

◆ QuantizationInfo() [4/5]

QuantizationInfo ( std::vector< float >  scale)
inline

Construct quantization info.

Note
Used for symmetric per channel quantization
Parameters
[in]scaleScale.

Definition at line 105 of file QuantizationInfo.h.

106  : _scale(scale), _offset()
107  {
108  }
const std::vector< float > & scale() const
Scale vector accessor.

◆ QuantizationInfo() [5/5]

QuantizationInfo ( std::vector< float >  scale,
std::vector< int32_t >  offset 
)
inline

Construct quantization info.

Note
Used for asymmetric per channel quantization
Parameters
[in]scaleScale.
[in]offsetOffset.

Definition at line 116 of file QuantizationInfo.h.

117  : _scale(scale), _offset(offset)
118  {
119  }
const std::vector< int32_t > & offset() const
Offset vector accessor.
const std::vector< float > & scale() const
Scale vector accessor.

Member Function Documentation

◆ empty()

◆ offset()

const std::vector<int32_t>& offset ( ) const
inline

◆ scale()

◆ uniform()

UniformQuantizationInfo uniform ( ) const
inline

Return per layer quantization info.

Returns
Uniform quantization information in case of empty information zero is returned in the respective fields

Definition at line 148 of file QuantizationInfo.h.

149  {
150  UniformQuantizationInfo uqinfo;
151  uqinfo.scale = _scale.empty() ? 0 : _scale[0];
152  uqinfo.offset = _offset.empty() ? 0 : _offset[0];
153 
154  return uqinfo;
155  }

References UniformQuantizationInfo::offset, and UniformQuantizationInfo::scale.

Referenced by arm_compute::quantization::compute_quantized_multipliers_and_shifts(), CLScaleKernel::configure(), CLGEMMMatrixVectorMultiplyKernel::configure(), CLComputeAllAnchorsKernel::configure(), CLComparisonKernel::configure(), CLActivationLayerKernel::configure(), CLWidthConcatenate2TensorsKernel::configure(), CLPoolingLayerKernel::configure(), CLPixelWiseMultiplicationKernel::configure(), CLQuantizationLayerKernel::configure(), CLWidthConcatenateLayerKernel::configure(), CLHeightConcatenateLayerKernel::configure(), CLWidthConcatenate4TensorsKernel::configure(), CLBoundingBoxTransformKernel::configure(), CLRangeKernel::configure(), CLDepthConcatenateLayerKernel::configure(), CLBatchConcatenateLayerKernel::configure(), CLROIAlignLayerKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), CLDirectConvolutionLayerKernel::configure(), NEDepthwiseConvolutionLayerNativeKernel::configure(), CLGEMMLowpMatrixMultiplyCore::configure(), NEGEMMLowpMatrixMultiplyCore::configure(), CLLSTMLayerQuantized::configure(), NELSTMLayerQuantized::configure(), CLGEMMDeconvolutionLayer::configure(), NEFullyConnectedLayer::configure(), CLGEMMConvolutionLayer::configure(), arm_compute::test::validation::convert_to_asymmetric(), arm_compute::test::validation::convert_to_symmetric(), VerifyAccessor< D >::fill_tensor(), arm_compute::test::validation::get_quantized_bounds(), arm_compute::test::validation::get_quantized_qasymm8_signed_bounds(), arm_compute::operator<<(), arm_compute::test::validation::reference::quantization_layer(), arm_compute::roi_align_1x1_qasymm8(), CPPUpsampleKernel::run(), NEWidthConcatenateLayerKernel::run(), NEHeightConcatenateLayerKernel::run(), NEDepthwiseConvolutionAssemblyDispatch::validate(), CLGEMMLowpMatrixMultiplyCore::validate(), NEGEMMLowpMatrixMultiplyCore::validate(), NEGenerateProposalsLayer::validate(), CLGenerateProposalsLayer::validate(), CLGEMMDeconvolutionLayer::validate(), CLLSTMLayerQuantized::validate(), NELSTMLayerQuantized::validate(), NEFullyConnectedLayer::validate(), arm_compute::validate(), and CLGEMMConvolutionLayer::validate().


The documentation for this class was generated from the following file: