diff options
Diffstat (limited to 'src/armnn/test/InferOutputTests.hpp')
-rw-r--r-- | src/armnn/test/InferOutputTests.hpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/armnn/test/InferOutputTests.hpp b/src/armnn/test/InferOutputTests.hpp index 6e2676ec8e..e2c854551f 100644 --- a/src/armnn/test/InferOutputTests.hpp +++ b/src/armnn/test/InferOutputTests.hpp @@ -464,6 +464,43 @@ void Convolution2dInferOutputShapeTest() CHECK(expectedOutputShape == convolution2dLayer->InferOutputShapes(shapes).at(0)); } +void Convolution3dInferOutputShapeTest() +{ + armnn::Graph graph; + + armnn::Convolution3dDescriptor descriptor; + descriptor.m_DilationX = 1; + descriptor.m_DilationY = 1; + descriptor.m_DilationZ = 1; + 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::Convolution3dLayer* const convolution3dLayer = + graph.AddLayer<armnn::Convolution3dLayer>(descriptor, "convolution3d"); + + std::vector<armnn::TensorShape> shapes; + const std::vector<unsigned int> inputSize = {1, 5, 5, 5, 1}; + armnn::TensorShape inputShape(5, inputSize.data()); + shapes.push_back(inputShape); + + const std::vector<unsigned int> filterSize = {3, 3, 3, 1, 1 }; + armnn::TensorShape filterShape(5, filterSize.data()); + shapes.push_back(filterShape); + + const std::vector<unsigned int> expectedOutputSizes = {1, 3, 3, 3, 1}; + armnn::TensorShape expectedOutputShape(5, expectedOutputSizes.data()); + + CHECK(expectedOutputShape == convolution3dLayer->InferOutputShapes(shapes).at(0)); +} + void TransposeConvolution2dInferOutputShapeTest() { armnn::Graph graph; |