6 #include "../Graph.hpp" 7 #include "../Network.hpp" 8 #include "../NetworkQuantizerUtils.hpp" 9 #include "../OverrideInputRangeVisitor.hpp" 19 #include <boost/test/unit_test.hpp> 21 #include <unordered_map> 36 class TestConnectionPreservation :
public LayerVisitorBase<VisitorNoThrowPolicy>
39 TestConnectionPreservation(
INetwork* network)
50 void CheckLayerName(
LayerGuid guid, std::string expectedName)
52 auto graph = m_Network->pNetworkImpl->GetGraph();
53 bool guidFound =
false;
54 for (
Layer* layer : graph)
58 BOOST_CHECK_EQUAL(layer->
GetName(), expectedName.c_str());
65 BOOST_FAIL(
"No layer matching the GUID was found");
75 auto graph = inputNetwork->
pNetworkImpl->GetGraph().TopologicalSort();
82 for (
auto&& inputLayer : network->
pNetworkImpl->GetGraph().GetInputLayers())
84 ARMNN_ASSERT_MSG(inputLayer->GetNumOutputSlots() == 1,
"Input layer should have exactly 1 output slot");
85 return inputLayer->GetOutputSlot(0).GetTensorInfo();
94 ARMNN_ASSERT_MSG(inputLayer->GetNumOutputSlots() == 1,
"Input layer should have exactly 1 output slot");
95 return inputLayer->GetOutputSlot(0).GetTensorInfo();
102 class TestQuantization :
public IStrategy 106 : m_InputShape(inputShape), m_OutputShape(outputShape), m_QuantizerOptions(
QuantizerOptions())
110 : m_InputShape(inputShape)
111 , m_OutputShape(outputShape)
112 , m_QuantizerOptions(options) {}
116 const std::vector<armnn::ConstTensor> &constants,
125 BOOST_TEST(m_OutputShape == info.
GetShape());
142 CheckDefaultQuantizationSettings(info);
172 TestQuantizationParams(
224 TestQuantizationParams(info,
235 TestQuantizationParams(
256 TestQuantizationParams(info, qAsymmU8Params, qAsymmS8Params, qSymmS8Params, qSymmS16Params);
273 if (constants.size() == 1)
277 else if (constants.size() == 1)
279 TestQuantizationOnLayersWithBiases(layer, constants[0], constants[1]);
285 if (constants.size() == 2)
287 TestQuantizationOnLayersWithBiases(layer, constants[0], constants[1]);
289 else if (constants.size() == 1)
302 TestQuantizationParams(info, qAsymmU8Params, qAsymmS8Params, qSymmS8Params, qSymmS16Params);
307 if (constants.size() == 2)
309 TestQuantizationOnLayersWithBiases(layer, constants[0], constants[1]);
311 else if (constants.size() == 1)
325 TestQuantizationParams(info, qAsymmU8Params, qAsymmS8Params, qSymmS8Params, qSymmS16Params);
330 BOOST_TEST(m_InputShape == info.
GetShape());
345 TestQuantizationParams(info, qAsymmU8Params, qAsymmS8Params, qSymmS8Params, qSymmS16Params);
355 TestQuantizationParams(info, qAsymmU8Params, qAsymmS8Params, qSymmS8Params, qSymmS16Params);
365 TestQuantizationParams(info, qAsymmU8Params, qAsymmS8Params, qSymmS8Params, qSymmS16Params);
379 TestQuantizationParams(info,
391 TestQuantizationParams(outputInfo,
400 if (constants.size() == 2)
402 TestQuantizationOnLayersWithBiases(layer, constants[0], constants[1]);
404 else if (constants.size() == 1)
428 void TestQuantizationParams(
const TensorInfo& info,
434 switch (m_QuantizerOptions.m_ActivationFormat)
437 TestQuantizationParamsImpl(
441 TestQuantizationParamsImpl(
445 TestQuantizationParamsImpl(
449 TestQuantizationParamsImpl(
462 void TestConstantQuantizationParams(
const TensorInfo& info,
467 TestQuantizationParamsImpl(info, dataType, params.first, params.second);
470 void TestBiasQuantizationParams(
const TensorInfo& info,
477 switch (m_QuantizerOptions.m_ActivationFormat)
480 TestQuantizationParamsImpl(info, dataType, qAsymmU8Params.first, qAsymmU8Params.second);
483 TestQuantizationParamsImpl(info, dataType, qAsymmS8Params.first, qAsymmS8Params.second);
486 TestQuantizationParamsImpl(info, dataType, qSymmS8Params.first, qSymmS8Params.second);
489 TestQuantizationParamsImpl(info, dataType, qSymmS16Params.first, qSymmS16Params.second);
508 TestQuantizationParams(info, {inputScaleQAsymmU8, 128},
509 {inputScaleQAsymmS8, 0},
510 {inputScaleQSymmS8, 0},
511 {inputScaleQSymmS16, 0});
513 TestConstantQuantizationParams(weights.
GetInfo(), {weightsScale, 85});
517 TestBiasQuantizationParams(biases.
value().GetInfo(),
518 {inputScaleQAsymmU8 * weightsScale, 0},
519 {inputScaleQAsymmS8 * weightsScale, 0},
520 {inputScaleQSymmS8 * weightsScale, 0},
521 {inputScaleQSymmS16 * weightsScale, 0},
530 void TestQuantizationParamsImpl(
const TensorInfo& info,
DataType dataType,
float scale, int32_t offset)
544 TestQuantization validatorQAsymmU8(inShape, outShape);
549 TestQuantization validatorQAsymmS8(qAsymmS8Options, inShape, outShape);
554 TestQuantization validatorQSymmS8(qSymmS8Options, inShape, outShape);
559 TestQuantization validatorQSymmS16(qSymmS16options, inShape, outShape);
662 std::vector<float> inputData({0, 0, 0, -56, 98, 0, 0, 0});
666 inputTensors.push_back(std::make_pair(0, inputTensor));
670 quantizer->Refine(inputTensors);
673 std::vector<float> inputData2({0, -77, 0, -56, 65, 0, 0, 0});
676 inputTensors2.push_back(std::make_pair(0, inputTensor2));
678 quantizer->Refine(inputTensors2);
680 INetworkPtr quantizedNetwork = quantizer->ExportNetwork();
683 std::unique_ptr<IQuantizationScheme> quantizationScheme = std::make_unique<QAsymmU8QuantizationScheme>();
684 OffsetScalePair qParams = quantizationScheme->ComputeScheme(-77.0, 98.0);
686 class TestOutputStrategy :
public IStrategy 690 m_OffsetScalePair(offsetScalePair), m_DataType(dataType) {}
694 const std::vector<armnn::ConstTensor>& constants,
705 BOOST_CHECK_MESSAGE(info.
GetDataType() == m_DataType,
712 boost::test_tools::tolerance(0.001));
725 TestOutputStrategy strategy(qParams, quantizationScheme->GetDataType());
726 quantizedNetwork->ExecuteStrategy(strategy);
733 descriptor.
m_A = 3.5f;
734 descriptor.
m_B = -10.0f;
757 descriptor.
m_A = 3.5f;
758 descriptor.
m_B = -10.0f;
771 descriptor.
m_A = 3.5f;
772 descriptor.
m_B = -10.0f;
784 descriptor.
m_A = 3.5f;
785 descriptor.
m_B = -10.0f;
797 descriptor.
m_A = 3.5f;
798 descriptor.
m_B = -10.0f;
810 descriptor.
m_A = 3.5f;
811 descriptor.
m_B = -10.0f;
823 descriptor.
m_A = 3.5f;
824 descriptor.
m_B = -10.0f;
862 std::vector<float> meanData{-1.0f, 1.5f, 2.0f};
863 std::vector<float> varData{-1.0f, 1.5f, 2.0f};
864 std::vector<float> betaData{-1.0f, 1.5f, 2.0f};
865 std::vector<float> gammaData{-1.0f, 1.5f, 2.0f};
876 IConnectableLayer* batchNorm = network->AddBatchNormalizationLayer(desc, mean, var, beta, gamma);
902 IConnectableLayer* depthToSpaceLayer = network->AddDepthToSpaceLayer(descriptor);
911 TestNetwork(network.get(), inputShape, outputShape);
982 BOOST_CHECK(!ranges.
IsEmpty());
1005 std::vector<float> weightsData{-1.0f, 1.5f, 2.0f};
1012 std::vector<float> biasData{10.0f, 20.0f, 30.0f};
1018 fullyConnected = network->AddFullyConnectedLayer(desc, weights, optionalBias);
1023 fullyConnected->GetOutputSlot(0).Connect(output->
GetInputSlot(0));
1027 fullyConnected->GetOutputSlot(0).SetTensorInfo(outputInfo);
1080 std::vector<float> weightsData{-1.0f, 1.5f, 2.0f};
1090 std::vector<float> biasesData{-1.0f, 1.5f, 2.0f};
1096 conv2d = network->AddConvolution2dLayer(descriptor, weights, optionalBiases);
1101 conv2d->GetOutputSlot(0).Connect(output->
GetInputSlot(0));
1105 conv2d->GetOutputSlot(0).SetTensorInfo(info);
1127 std::vector<float> weightsData{-1.0f, 1.5f, 2.0f};
1137 std::vector<float> biasesData{-1.0f, 1.5f, 2.0f};
1143 depthwiseConv2d = network->AddDepthwiseConvolution2dLayer(descriptor, weights, optionalBiases);
1148 depthwiseConv2d->GetOutputSlot(0).Connect(output->
GetInputSlot(0));
1152 depthwiseConv2d->GetOutputSlot(0).SetTensorInfo(info);
1195 descriptor.
m_Beta = 1.0f;
1234 descriptor.
m_Beta = 1.0f;
1287 activationDescriptor.
m_A = 3.5f;
1288 activationDescriptor.
m_B = -10.0f;
1381 activationDescriptor.
m_A = 3.5f;
1382 activationDescriptor.
m_B = -10.0f;
1386 IConnectableLayer* activation = network->AddActivationLayer(activationDescriptor);
1408 std::vector<float> data = {-2.0f, -1.0f, 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f};
1448 IConnectableLayer* argMinMaxLayer = network->AddArgMinMaxLayer(argMinMaxDescriptor);
1461 TestNetwork(network.get(), inputShape, outputShape);
1490 class TestConcatQuantization :
public TestQuantization
1494 : TestQuantization(inputShape, outputShape) {}
1499 : TestQuantization(options, inputShape, outputShape) {}
1503 const std::vector<armnn::ConstTensor>& constants,
1518 TestQuantizationParams(
1528 TestDifferentQuantizationScale(inputInfo0, inputInfo1);
1529 TestDifferentQuantizationScale(inputInfo0, inputInfo2);
1530 TestDifferentQuantizationScale(inputInfo1, inputInfo2);
1531 TestDifferentQuantizationScale(inputInfo0, outputInfo);
1575 quantizerPtrQAsymmU8->OverrideInputRange(0, (min + 2.1f), (max - 3.2f));
1576 quantizerPtrQAsymmU8->OverrideInputRange(1, (min + 6.7f), max);
1577 quantizerPtrQAsymmU8->OverrideInputRange(2, min, (max - 7.8f));
1579 quantizerPtrQSymmS8->OverrideInputRange(0, (min + 2.1f), (max - 3.2f));
1580 quantizerPtrQSymmS8->OverrideInputRange(1, (min + 6.7f), max);
1581 quantizerPtrQSymmS8->OverrideInputRange(2, min, (max - 7.8f));
1583 quantizerPtrQSymmS16->OverrideInputRange(0, (min + 2.1f), (max - 3.2f));
1584 quantizerPtrQSymmS16->OverrideInputRange(1, (min + 6.7f), max);
1585 quantizerPtrQSymmS16->OverrideInputRange(2, min, (max - 7.8f));
1587 INetworkPtr quantizedNetworkQAsymmU8 = quantizerPtrQAsymmU8->ExportNetwork();
1588 TestConcatQuantization validatorQAsymmU8(shape, shape);
1591 INetworkPtr quantizedNetworkQSymmS8 = quantizerPtrQSymmS8->ExportNetwork();
1592 TestConcatQuantization validatorQSymmS8(qSymmS8Options, shape, shape);
1595 INetworkPtr quantizedNetworkQSymmS16 = quantizerPtrQSymmS16->ExportNetwork();
1596 TestConcatQuantization validatorQSymmS16(qSymmS16options, shape, shape);
1647 descriptor.m_TargetWidth = 3;
1666 IConnectableLayer* stridedSlice = network->AddStridedSliceLayer(stridedSliceDesc);
1693 class TestPreluQuantization :
public TestQuantization
1696 TestPreluQuantization(
const TensorShape& inputShape,
1699 : TestQuantization(inputShape, outputShape)
1700 , m_AlphaShape(alphaShape)
1707 : TestQuantization(options, inputShape, outputShape)
1708 , m_AlphaShape(alphaShape)
1713 const std::vector<armnn::ConstTensor>& constants,
1728 BOOST_TEST(m_InputShape == info.
GetShape());
1731 BOOST_TEST(m_AlphaShape == info.
GetShape());
1738 TestQuantizationParams(info,
1748 BOOST_TEST(m_OutputShape == info.
GetShape());
1754 TestQuantizationParams(info,
1800 TestPreluQuantization validatorQAsymmU8(inputShape, alphaShape, outputShape);
1805 TestPreluQuantization validatorQAsymmS8(qAsymmS8Options, inputShape, alphaShape, outputShape);
1810 TestPreluQuantization validatorQSymmS8(qSymmS8Options, inputShape, alphaShape, outputShape);
1815 TestPreluQuantization validatorQSymmS16(qSymmS16options, inputShape, alphaShape, outputShape);
1826 std::initializer_list<float> floatData{ -1.0f, 1.5f, 2.0f };
1827 std::vector<float> weightsData(floatData);
1836 std::vector<float> biasesData(floatData);
1842 IConnectableLayer* transposeConv2d = network->AddTransposeConvolution2dLayer(descriptor, weights, optionalBiases);
1846 transposeConv2d->GetOutputSlot(0).Connect(output->
GetInputSlot(0));
1849 transposeConv2d->GetOutputSlot(0).SetTensorInfo(info);
1866 class TestStackQuantization :
public TestQuantization
1869 TestStackQuantization(
const TensorShape& inputShape,
1871 : TestQuantization(inputShape, outputShape) {}
1876 : TestQuantization(options, inputShape, outputShape) {}
1880 const std::vector<armnn::ConstTensor>& constants,
1900 TestQuantizationParams(outputInfo,
1931 TestStackQuantization validatorQAsymmU8(inputShape, outputShape);
1936 TestStackQuantization validatorQAsymmS8(qAsymmS8Options, inputShape, inputShape);
1941 TestStackQuantization validatorQSymmS8(qSymmS8Options, inputShape, inputShape);
1946 TestStackQuantization validatorQSymmS16(qSymmS16options, inputShape, outputShape);
1974 inputInfo.SetQuantizationOffset(1);
1975 std::vector<float> input({ value, 0.0f, 0.0f, 1.0f });
1976 const std::vector<float> &inputRef = input;
1978 auto output = armnnUtils::QuantizedVector<uint8_t>(inputRef,
1979 inputInfo.GetQuantizationScale(),
1980 inputInfo.GetQuantizationOffset());
1987 BOOST_CHECK_EQUAL(
SetupQuantize(std::numeric_limits<float>::infinity())[0], 255);
1992 BOOST_CHECK_EQUAL(
SetupQuantize(-1 * std::numeric_limits<float>::infinity())[0], 0);
1995 class TestPreserveType :
public TestQuantization
2002 : TestQuantization(options, inputShape, outputShape)
2003 , m_DataType(dataType)
2004 , m_VisitedQuantizeLayer(
false)
2005 , m_VisitedDequantizeLayer(
false) {}
2009 const std::vector<armnn::ConstTensor>& constants,
2021 BOOST_TEST(m_InputShape == info.
GetShape());
2028 BOOST_TEST(m_OutputShape == info.
GetShape());
2033 m_VisitedQuantizeLayer =
true;
2038 m_VisitedDequantizeLayer =
true;
2046 void CheckQuantizeDequantizeLayerVisited(
bool expected)
2050 BOOST_CHECK(m_VisitedQuantizeLayer);
2051 BOOST_CHECK(m_VisitedDequantizeLayer);
2055 BOOST_CHECK(!m_VisitedQuantizeLayer);
2056 BOOST_CHECK(!m_VisitedDequantizeLayer);
2061 bool m_VisitedQuantizeLayer;
2062 bool m_VisitedDequantizeLayer;
2089 TestPreserveType validatorQAsymmU8(options, dataType, shape, shape);
2091 validatorQAsymmU8.CheckQuantizeDequantizeLayerVisited(
2117 class TestConnectionPreservation :
public IStrategy 2120 TestConnectionPreservation(
const Graph& graph)
2126 const std::vector<armnn::ConstTensor>& constants,
2145 void CheckLayerName(
LayerGuid guid, std::string expectedName)
2147 bool guidFound =
false;
2148 for (
Layer* layer : m_Graph)
2152 BOOST_CHECK_EQUAL(layer->
GetName(), expectedName.c_str());
2159 BOOST_FAIL(
"No layer matching the GUID was found");
2171 return pNetworkImpl.get();
2181 IConnectableLayer* reLULayer1 = testNetwork.AddActivationLayer(ReLUDesc,
"reLU1");
2182 IConnectableLayer* reLULayer2 = testNetwork.AddActivationLayer(ReLUDesc,
"reLU2");
2197 TestConnectionPreservation strategy1(testNetwork.GetPNetworkImpl()->GetGraph());
2204 std::vector<float> inputData({0, 2, 0, 4});
2208 inputTensors.push_back(std::make_pair(0, inputTensor));
2209 quantizer->Refine(inputTensors);
2211 INetworkPtr quantNetwork = quantizer->ExportNetwork();
2215 TestConnectionPreservation strategy2(testQuantNetwork->GetPNetworkImpl()->GetGraph());
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
const float g_AsymmU8QuantizationBase
bool m_BiasEnabled
Enable/disable bias.
IConnectableLayer * AddActivationLayer(const ActivationDescriptor &activationDescriptor, const char *name=nullptr)
Adds an activation layer to the network.
std::pair< float, int > OffsetScalePair
A ViewsDescriptor for the SplitterLayer.
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
bool m_BiasEnabled
Enable/disable bias.
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
const TensorShape & GetShape() const
A ReshapeDescriptor for the ReshapeLayer.
IConnectableLayer * AddAdditionLayer(const char *name=nullptr)
TensorInfo GetInputTensorInfo(const INetwork *network)
INetworkPtr CreateNetworkWithActivationLayer(const ActivationDescriptor &descriptor, const TensorShape &shape)
A ComparisonDescriptor for the ComparisonLayer.
void TestNetwork(INetwork *network, const TensorShape inShape, const TensorShape outShape)
A Convolution2dDescriptor for the Convolution2dLayer.
INetworkPtr CreateNetworkWithInputOutputLayers()
bool m_BiasEnabled
Enable/disable bias.
float m_Beta
Exponentiation value.
const float g_SymmS8QuantizationBase
ArgMinMaxFunction m_Function
Specify if the function is to find Min or Max.
std::unique_ptr< class INetworkQuantizer, void(*)(INetworkQuantizer *quantizer)> INetworkQuantizerPtr
Main network class which provides the interface for building up a neural network. ...
std::vector< std::pair< LayerBindingId, class ConstTensor > > InputTensors
std::vector< uint8_t > SetupQuantize(float value)
Copyright (c) 2021 ARM Limited and Contributors.
void IgnoreUnused(Ts &&...)
INetworkPtr CreateNetworkWithFullyConnectedLayer(const bool biasEnabled, const TensorShape &inputShape, const TensorShape &outputShape)
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
std::pair< float, float > MinMaxRange
Private implementation of INetwork.
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
IConnectableLayer * AddInputLayer(LayerBindingId id, const char *name=nullptr)
Adds an input layer to the network.
uint32_t m_NumOutputs
Number of output tensors.
INetworkPtr CreateNetworkWithArgMinMaxLayer(const ArgMinMaxDescriptor &descriptor, const TensorShape &shape)
constexpr const char * GetDataTypeName(DataType dataType)
A ResizeDescriptor for the ResizeLayer.
MinMaxRange GetRange(LayerGuid guid, unsigned int idx) const
Retrieve the Range for a particular output slot on a particular layer.
Base class for all descriptors.
A StackDescriptor for the StackLayer.
std::unique_ptr< NetworkImpl > pNetworkImpl
IConnectableLayer * AddInputLayer(LayerBindingId id, const char *name=nullptr)
IConnectableLayer * CreateStartOfLeakyReluNetwork(INetwork *network, const TensorInfo &info)
#define ARMNN_ASSERT_MSG(COND, MSG)
void ApplyStrategyToLayers(const LayerContainer &layerContainer, IStrategy &strategy)
int32_t GetQuantizationOffset() const
An ArgMinMaxDescriptor for ArgMinMaxLayer.
float GetQuantizationScale() const
DataType GetDataType() const
An OriginsDescriptor for the ConcatLayer.
bool has_value() const noexcept
std::unordered_map< LayerGuid, MinMaxRanges > MinMaxRangeMap
A FullyConnectedDescriptor for the FullyConnectedLayer.
virtual LayerGuid GetGuid() const =0
Returns the unique id of the layer.
bool m_BiasEnabled
Enable/disable bias.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
IConnectableLayer * AddOutputLayer(LayerBindingId id, const char *name=nullptr)
Adds an output layer to the network.
bool HasRanges(LayerGuid guid) const
Query that there is an entry for a layer.
void TestQuantizeDepthwiseConvolution2d(bool useBiases)
IConnectableLayer * AddOutputLayer(LayerBindingId id, const char *name=nullptr)
std::vector< MinMaxRange > MinMaxRanges
void SetQuantizationScale(float scale)
A StandInDescriptor for the StandIn layer.
BOOST_AUTO_TEST_CASE(CheckConvolution2dLayer)
An ActivationDescriptor for the ActivationLayer.
const TensorInfo & GetInfo() const
min(a, max(b, input)) ReLu1 & ReLu6.
uint32_t m_TargetHeight
Target height value.
A SliceDescriptor for the SliceLayer.
Visitor base class with empty implementations.
const float g_TestTolerance
virtual LayerType GetType() const =0
Returns the armnn::LayerType of this layer.
void ValidateFullyConnectedLayer(const bool biasEnabled)
const float g_SymmS16QuantizationBase
bool IsEmpty() const
Query function to check that the RangeTracker is empty.
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
float m_A
Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH, Elu).
BOOST_AUTO_TEST_SUITE_END()
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
std::pair< float, float > MinMaxRange
void QuantizeConstant(const srcType *src, uint8_t *dst, size_t numElements, float &scale, int &offset)
uint32_t m_NumInputs
Number of input tensors.
void TestQuantizeConvolution2d(bool useBiases)
void VisitLayersTopologically(const INetwork *inputNetwork, IStrategy &visitor)
const Graph & GetGraph() const
void CompleteLeakyReluNetwork(INetwork *network, IConnectableLayer *activation, IConnectableLayer *layerUnderTest, const TensorInfo &info)
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
Get a const input slot handle by slot index.
A StridedSliceDescriptor for the StridedSliceLayer.
virtual const TensorInfo & GetTensorInfo() const =0
virtual const IOutputSlot & GetOutputSlot(unsigned int index) const =0
Get the const output slot handle by slot index.
virtual const char * GetName() const =0
Returns the name of the layer.
InputLayersAccessor GetInputLayers() const
Returns a wrapper object with begin(), end() methods to iterate over the input layers in a range-base...
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
INetworkPtr CreateNetworkWithSoftmaxLayer(const SoftmaxDescriptor &descriptor, const TensorShape &shape)
virtual int Connect(IInputSlot &destination)=0
virtual LayerGuid GetOwningLayerGuid() const =0
void PreserveTypeTestImpl(const DataType &dataType)
A Pooling2dDescriptor for the Pooling2dLayer.
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
static INetworkPtr Create(NetworkOptions networkOptions={})
float m_B
Beta lower bound value used by the activation functions. (BoundedReLu, Linear, TanH).
A SoftmaxDescriptor for the SoftmaxLayer.
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square, Elu).
void TestQuantizeTransposeConvolution2d(bool useBiases)
const float g_AsymmS8QuantizationBase
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
static INetworkQuantizerPtr Create(INetwork *inputNetwork, const QuantizerOptions &options=QuantizerOptions())
Create Quantizer object wrapped in unique_ptr.
A FillDescriptor for the FillLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
A PermuteDescriptor for the PermuteLayer.