Compute Library
 20.08
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 70 of file QuantizationInfo.h.

Constructor & Destructor Documentation

◆ QuantizationInfo() [1/5]

QuantizationInfo ( )
inlinenoexcept

Default constructor.

Definition at line 74 of file QuantizationInfo.h.

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

◆ QuantizationInfo() [2/5]

QuantizationInfo ( float  scale)
inline

Construct quantization info.

Note
Used for symmetric quantization
Parameters
[in]scaleScale.

Definition at line 85 of file QuantizationInfo.h.

86  : _scale(1, scale), _offset()
87  {
88  }
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 96 of file QuantizationInfo.h.

97  : _scale(1, scale), _offset(1, offset)
98  {
99  }
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 106 of file QuantizationInfo.h.

107  : _scale(scale), _offset()
108  {
109  }
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 117 of file QuantizationInfo.h.

118  : _scale(scale), _offset(offset)
119  {
120  }
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 149 of file QuantizationInfo.h.

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

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

Referenced by arm_compute::quantization::compute_quantized_multipliers_and_shifts(), CLScaleKernel::configure(), CLActivationLayerKernel::configure(), CLWidthConcatenate2TensorsKernel::configure(), CLWidthConcatenateLayerKernel::configure(), CLHeightConcatenateLayerKernel::configure(), CLWidthConcatenate4TensorsKernel::configure(), CLGEMMMatrixVectorMultiplyKernel::configure(), CLDepthConcatenateLayerKernel::configure(), NEQLSTMLayerNormalizationKernel::configure(), CLBatchConcatenateLayerKernel::configure(), CLComputeAllAnchorsKernel::configure(), CLQLSTMLayerNormalizationKernel::configure(), CLComparisonKernel::configure(), CLQuantizationLayerKernel::configure(), CLRangeKernel::configure(), CLPoolingLayerKernel::configure(), NEDepthwiseConvolutionLayerNativeKernel::configure(), CLBoundingBoxTransformKernel::configure(), CLROIAlignLayerKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), CLDirectConvolutionLayerKernel::configure(), CLGEMMLowpMatrixMultiplyCore::configure(), NEGEMMLowpMatrixMultiplyCore::configure(), NELSTMLayerQuantized::configure(), CLPixelWiseMultiplicationKernel::configure(), CLGEMMDeconvolutionLayer::configure(), NEQLSTMLayer::configure(), CLLSTMLayerQuantized::configure(), CLQLSTMLayer::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(), main(), arm_compute::operator<<(), arm_compute::test::validation::reference::quantization_layer(), arm_compute::roi_align_1x1_qasymm8(), CPPUpsampleKernel::run(), NEWidthConcatenateLayerKernel::run_op(), NEHeightConcatenateLayerKernel::run_op(), NEDepthwiseConvolutionAssemblyDispatch::validate(), NEGenerateProposalsLayer::validate(), CLGEMMLowpMatrixMultiplyCore::validate(), NEGEMMLowpMatrixMultiplyCore::validate(), CLGenerateProposalsLayer::validate(), NELSTMLayerQuantized::validate(), CLLSTMLayerQuantized::validate(), NEQLSTMLayer::validate(), arm_compute::validate(), CLQLSTMLayer::validate(), and CLGEMMConvolutionLayer::validate().


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