diff options
author | Tamás Nyíri <tamas.nyiri@arm.com> | 2021-10-26 14:47:57 +0100 |
---|---|---|
committer | Tamas Nyiri <tamas.nyiri@arm.com> | 2021-11-17 11:31:44 +0000 |
commit | 7b885b3cce70154596b1994b013ea91527117c26 (patch) | |
tree | cdc2ee30a6dc03a4e26e6783a84ccd9be867242a /src/armnn/test/InferOutputTests.hpp | |
parent | 888a363115e0bf47f227c9db6fc1dbfe0418f69c (diff) | |
download | armnn-7b885b3cce70154596b1994b013ea91527117c26.tar.gz |
IVGCVSW-6509 Front End + Reference Workload implementation
Subtask of story: IVGCVSW-6164 Add a Pooling3d FrontEnd and Ref Implementation
* Add front end
* Add reference workload
* Add corresponding unit tests
Change-Id: Icce4146dd0a06a1da46a2def00a82d343e171750
Signed-off-by: Tamas Nyiri <tamas.nyiri@arm.com>
Diffstat (limited to 'src/armnn/test/InferOutputTests.hpp')
-rw-r--r-- | src/armnn/test/InferOutputTests.hpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/armnn/test/InferOutputTests.hpp b/src/armnn/test/InferOutputTests.hpp index e2c854551f..6435d87be3 100644 --- a/src/armnn/test/InferOutputTests.hpp +++ b/src/armnn/test/InferOutputTests.hpp @@ -565,6 +565,40 @@ void DepthwiseConvolution2dInferOutputShapeTest() CHECK(expectedOutputShape == depthwiseConvolution2dLayer->InferOutputShapes(shapes).at(0)); } +void Pooling3dInferOutputShapeTest() +{ + armnn::Graph graph; + + armnn::Pooling3dDescriptor descriptor; + descriptor.m_PoolType = armnn::PoolingAlgorithm::Max; + descriptor.m_PoolDepth = 2; + descriptor.m_PoolHeight = 2; + descriptor.m_PoolWidth = 2; + descriptor.m_PadTop = 1; + descriptor.m_PadBottom = 1; + descriptor.m_PadLeft = 1; + descriptor.m_PadRight = 1; + descriptor.m_PadFront = 1; + descriptor.m_PadBack = 1; + descriptor.m_StrideX = 2; + descriptor.m_StrideY = 2; + descriptor.m_StrideZ = 2; + descriptor.m_DataLayout = armnn::DataLayout::NDHWC; + + armnn::Pooling3dLayer* const pooling3dLayer = + graph.AddLayer<armnn::Pooling3dLayer>(descriptor, "pooling3d"); + + std::vector<armnn::TensorShape> shapes; + const std::vector<unsigned int> inputSize = {1, 4, 4, 4, 1}; + armnn::TensorShape inputShape(5, inputSize.data()); + shapes.push_back(inputShape); + + const std::vector<unsigned int> expectedOutputSizes = {1, 3, 3, 3, 1}; + armnn::TensorShape expectedOutputShape(5, expectedOutputSizes.data()); + + CHECK(expectedOutputShape == pooling3dLayer->InferOutputShapes(shapes).at(0)); +} + // QLstm void QLstmInferOutputShapeImpl(const armnn::QLstmDescriptor descriptor, const std::vector<armnn::TensorShape>& inputShapes, |