From 972af1568372f243f241b58fa07f0d3a7f991d1e Mon Sep 17 00:00:00 2001 From: Aron Virginas-Tar Date: Tue, 11 Jun 2019 14:14:03 +0100 Subject: IVGCVSW-3258 Add front end support for new SpaceToDepth layer Signed-off-by: Aron Virginas-Tar Change-Id: Id677e29a734f2b36483d939ad370079bdc11551e --- src/armnn/test/LayerValidateOutputTest.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'src/armnn/test/LayerValidateOutputTest.cpp') diff --git a/src/armnn/test/LayerValidateOutputTest.cpp b/src/armnn/test/LayerValidateOutputTest.cpp index 999844e252..acefd51110 100644 --- a/src/armnn/test/LayerValidateOutputTest.cpp +++ b/src/armnn/test/LayerValidateOutputTest.cpp @@ -4,11 +4,12 @@ // #include -#include -#include -#include #include +#include +#include +#include +#include BOOST_AUTO_TEST_SUITE(LayerValidateOutput) @@ -35,4 +36,26 @@ BOOST_AUTO_TEST_CASE(TestBatchToSpaceInferOutputShape) BOOST_CHECK(expectedShape == batchToSpaceLayer->InferOutputShapes(shapes).at(0)); } +BOOST_AUTO_TEST_CASE(TestSpaceToDepthInferOutputShape) +{ + armnn::Graph graph; + + armnn::SpaceToDepthDescriptor descriptor; + descriptor.m_BlockSize = 2; + descriptor.m_DataLayout = armnn::DataLayout::NHWC; + + armnn::SpaceToDepthLayer* const spaceToDepthLayer = + graph.AddLayer(descriptor, "spaceToDepth"); + + std::vector shapes; + const std::vector dimSizes{ 1, 16, 8, 3 }; + armnn::TensorShape shape(4, dimSizes.data()); + shapes.push_back(shape); + + const std::vector expectedDimSizes{ 1, 8, 4, 12 }; + armnn::TensorShape expectedShape(4, expectedDimSizes.data()); + + BOOST_CHECK(expectedShape == spaceToDepthLayer->InferOutputShapes(shapes).at(0)); +} + BOOST_AUTO_TEST_SUITE_END() -- cgit v1.2.1