ArmNN
 20.11
QuantizerTest.cpp File Reference

Go to the source code of this file.

Namespaces

 armnn
 Copyright (c) 2020 ARM Limited.
 

Typedefs

using MinMaxRange = std::pair< float, float >
 
using MinMaxRanges = std::vector< MinMaxRange >
 
using MinMaxRangeMap = std::unordered_map< LayerGuid, MinMaxRanges >
 

Functions

void VisitLayersTopologically (const INetwork *inputNetwork, ILayerVisitor &visitor)
 
 BOOST_AUTO_TEST_CASE (QuantizeAddition)
 
INetworkPtr CreateNetworkWithActivationLayer (const ActivationDescriptor &descriptor, const TensorShape &shape)
 
INetworkPtr CreateNetworkWithInputOutputLayers ()
 
TensorInfo GetInputTensorInfo (const Network *network)
 
 BOOST_AUTO_TEST_CASE (InputOutputLayerDynamicQuant)
 
 BOOST_AUTO_TEST_CASE (QuantizeAbsActivation)
 
 BOOST_AUTO_TEST_CASE (QuantizeLinearActivation)
 
 BOOST_AUTO_TEST_CASE (QuantizeReLuActivation)
 
 BOOST_AUTO_TEST_CASE (QuantizeSoftReLuActivation)
 
 BOOST_AUTO_TEST_CASE (QuantizeBoundedReluActivation)
 
 BOOST_AUTO_TEST_CASE (QuantizeTanHActivation)
 
 BOOST_AUTO_TEST_CASE (QuantizeLeakyReLuActivation)
 
 BOOST_AUTO_TEST_CASE (QuantizeELuActivation)
 
 BOOST_AUTO_TEST_CASE (QuantizeHardSwishActivation)
 
 BOOST_AUTO_TEST_CASE (QuantizeBatchNorm)
 
 BOOST_AUTO_TEST_CASE (QuantizeDepthToSpace)
 
 BOOST_AUTO_TEST_CASE (OverrideInputRangeEmptyNetwork)
 
 BOOST_AUTO_TEST_CASE (OverrideInputRangeNoInputLayers)
 
 BOOST_AUTO_TEST_CASE (OverrideInputRangeInputLayers)
 
INetworkPtr CreateNetworkWithFullyConnectedLayer (const bool biasEnabled, const TensorShape &inputShape, const TensorShape &outputShape)
 
void ValidateFullyConnectedLayer (const bool biasEnabled)
 
 BOOST_AUTO_TEST_CASE (QuantizeFill)
 
 BOOST_AUTO_TEST_CASE (QuantizeFullyConnected)
 
 BOOST_AUTO_TEST_CASE (QuantizeFullyConnectedBiasEnabled)
 
void TestQuantizeConvolution2d (bool useBiases)
 
 BOOST_AUTO_TEST_CASE (QuantizeConvolution2d)
 
 BOOST_AUTO_TEST_CASE (QuantizeConvolution2dWithBiases)
 
void TestQuantizeDepthwiseConvolution2d (bool useBiases)
 
 BOOST_AUTO_TEST_CASE (QuantizeDepthwiseConvolution2d)
 
 BOOST_AUTO_TEST_CASE (QuantizeDepthwiseConvolution2dWithBiases)
 
 BOOST_AUTO_TEST_CASE (QuantizeInstanceNormalization)
 
 BOOST_AUTO_TEST_CASE (QuantizeLogSoftmax)
 
INetworkPtr CreateNetworkWithSoftmaxLayer (const SoftmaxDescriptor &descriptor, const TensorShape &shape)
 
 BOOST_AUTO_TEST_CASE (QuantizeSoftmax)
 
 BOOST_AUTO_TEST_CASE (QuantizeStandIn)
 
IConnectableLayer * CreateStartOfLeakyReluNetwork (INetwork *network, const TensorInfo &info)
 
void CompleteLeakyReluNetwork (INetwork *network, IConnectableLayer *activation, IConnectableLayer *layerUnderTest, const TensorInfo &info)
 
 BOOST_AUTO_TEST_CASE (QuantizePermute)
 
 BOOST_AUTO_TEST_CASE (QuantizeSpaceToBatch)
 
 BOOST_AUTO_TEST_CASE (QuantizeSpaceToDepth)
 
 BOOST_AUTO_TEST_CASE (QuantizePooling2d)
 
 BOOST_AUTO_TEST_CASE (QuantizeConstant)
 
 BOOST_AUTO_TEST_CASE (QuantizeArgMinMax)
 
 BOOST_AUTO_TEST_CASE (QuantizeComparison)
 
 BOOST_AUTO_TEST_CASE (QuantizeConcat)
 
 BOOST_AUTO_TEST_CASE (QuantizeReshape)
 
 BOOST_AUTO_TEST_CASE (QuantizeSplitter)
 
 BOOST_AUTO_TEST_CASE (QuantizeResize)
 
 BOOST_AUTO_TEST_CASE (QuantizeStridedSlice)
 
 BOOST_AUTO_TEST_CASE (QuantizeBatchToSpace)
 
 BOOST_AUTO_TEST_CASE (QuantizePrelu)
 
void TestQuantizeTransposeConvolution2d (bool useBiases)
 
 BOOST_AUTO_TEST_CASE (QuantizeTransposeConvolution2d)
 
 BOOST_AUTO_TEST_CASE (QuantizeTransposeConvolution2dWithBiases)
 
 BOOST_AUTO_TEST_CASE (QuantizeStack)
 
 BOOST_AUTO_TEST_CASE (QuantizeSlice)
 
std::vector< uint8_t > SetupQuantize (float value)
 
 BOOST_AUTO_TEST_CASE (QuantizeInf)
 
 BOOST_AUTO_TEST_CASE (QuantizeNegativeInf)
 
void PreserveTypeTestImpl (const DataType &dataType)
 
 BOOST_AUTO_TEST_CASE (PreserveTypeFloat32)
 
 BOOST_AUTO_TEST_CASE (PreserveTypeQAsymmU8)
 
 BOOST_AUTO_TEST_CASE (PreserveTypeQsymm8)
 
 BOOST_AUTO_TEST_CASE (PreserveTypeQsymm16)
 
 BOOST_AUTO_TEST_CASE (TestConnectionPreservationAfterDynamicQuant)
 

Variables

const float g_AsymmU8QuantizationBase = 255.0f
 
const float g_AsymmS8QuantizationBase = 255.0f
 
const float g_SymmS8QuantizationBase = 127.0f
 
const float g_SymmS16QuantizationBase = 32767.0f
 
const float g_TestTolerance = 0.000001f