diff options
author | Sadik Armagan <sadik.armagan@arm.com> | 2019-10-23 11:22:39 +0100 |
---|---|---|
committer | Sadik Armagan <sadik.armagan@arm.com> | 2019-10-23 11:22:39 +0100 |
commit | c95b8381ac73a975ad82b930f9ed3049901c6753 (patch) | |
tree | ed2dc86fb27e3569a6bb6ecf13fccd9fc39b9675 /src/armnn/test/QuantizerTest.cpp | |
parent | d80cc0c9766b87a4cfe530ad90e11ed1e706d890 (diff) | |
download | armnn-c95b8381ac73a975ad82b930f9ed3049901c6753.tar.gz |
IVGCVSW-4013 Test that the quantizer fails gracefully
* Added Quantizer test for StandIn Layer
Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Change-Id: I48bb9cadb48e20ee8e5b3dcf9e2f9fdb3b68351d
Diffstat (limited to 'src/armnn/test/QuantizerTest.cpp')
-rw-r--r-- | src/armnn/test/QuantizerTest.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/armnn/test/QuantizerTest.cpp b/src/armnn/test/QuantizerTest.cpp index e7feef57c5..90fd5e90dd 100644 --- a/src/armnn/test/QuantizerTest.cpp +++ b/src/armnn/test/QuantizerTest.cpp @@ -1179,6 +1179,37 @@ BOOST_AUTO_TEST_CASE(QuantizeSoftmax) VisitLayersTopologically(quantizedNetworkQSymm16.get(), validatorQSymm16); } +BOOST_AUTO_TEST_CASE(QuantizeStandIn) +{ + const TensorShape tensorShape{ 1U }; + const TensorInfo tensorInfo(tensorShape, DataType::Float32); + + INetworkPtr network = INetwork::Create(); + + StandInDescriptor descriptor; + descriptor.m_NumInputs = 1; + descriptor.m_NumOutputs = 1; + + IConnectableLayer* inputLayer = network->AddInputLayer(0); + IConnectableLayer* standInLayer = network->AddStandInLayer(descriptor); + IConnectableLayer* outputLayer = network->AddOutputLayer(0); + + inputLayer->GetOutputSlot(0).Connect(standInLayer->GetInputSlot(0)); + standInLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0)); + + inputLayer->GetOutputSlot(0).SetTensorInfo(tensorInfo); + standInLayer->GetOutputSlot(0).SetTensorInfo(tensorInfo); + + // test QAsymm8 quantization + BOOST_CHECK_THROW(INetworkQuantizer::Create(network.get())->ExportNetwork(), + armnn::UnimplementedException); + + // test QuantisedSymm16 quantization + const QuantizerOptions options(DataType::QuantisedSymm16); + BOOST_CHECK_THROW(INetworkQuantizer::Create(network.get(), options)->ExportNetwork(), + armnn::UnimplementedException); +} + IConnectableLayer* CreateStartOfLeakyReluNetwork(INetwork* network, const TensorInfo& info) { ActivationDescriptor activationDescriptor; |