From 2ee88dfe7096f8f571ae7be9cbf0f49ededd89af Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Mon, 18 Feb 2019 10:42:32 +0000 Subject: IVGCVSW-2626 Add Quantization of ResizeBilinear Layer Change-Id: I0daffd23f32cc094d8309aed822cc46bb2aaa46f Signed-off-by: Jim Flynn --- src/armnn/test/QuantizerTest.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/armnn/test') diff --git a/src/armnn/test/QuantizerTest.cpp b/src/armnn/test/QuantizerTest.cpp index 1f6537d16a..21ac3e66ec 100644 --- a/src/armnn/test/QuantizerTest.cpp +++ b/src/armnn/test/QuantizerTest.cpp @@ -1120,5 +1120,38 @@ BOOST_AUTO_TEST_CASE(QuantizeSplitter) VisitLayersTopologically(quantizedNetwork.get(), validator); } +BOOST_AUTO_TEST_CASE(QuantizeResizeBilinear) +{ + class TestResizeBilinearQuantization : public TestLeakyReLuActivationQuantization + { + public: + void VisitResizeBilinearLayer(const IConnectableLayer* layer, + const ResizeBilinearDescriptor& resizeDescriptor, + const char* name = nullptr) override + { + CheckForwardedQuantizationSettings(layer); + } + }; + + INetworkPtr network = INetwork::Create(); + + TensorShape shape{1U}; + TensorInfo info(shape, DataType::Float32); + + IConnectableLayer* activation = CreateStartOfLeakyReluNetwork(network.get(), info); + + // Add the layer under test + ResizeBilinearDescriptor descriptor; + descriptor.m_TargetHeight = 3; + descriptor.m_TargetWidth = 3; + IConnectableLayer* spaceToBatch = network->AddResizeBilinearLayer(descriptor); + + CompleteLeakyReluNetwork(network.get(), activation, spaceToBatch, info); + + auto quantizedNetwork = INetworkQuantizer::Create(network.get())->ExportNetwork(); + TestResizeBilinearQuantization validator; + VisitLayersTopologically(quantizedNetwork.get(), validator); +} + BOOST_AUTO_TEST_SUITE_END() } // namespace armnn -- cgit v1.2.1