aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kelly <mike.kelly@arm.com>2019-07-11 11:46:21 +0100
committermike.kelly <mike.kelly@arm.com>2019-07-11 12:24:45 +0000
commit05bfbd34ec06c2dc3b0c89f0ede5de587cdbb3a2 (patch)
tree8463bb7597dd1997c1c9617904c2e74d4369f828
parent4b961d36bc80e2f302362011af92649635cbfbc5 (diff)
downloadarmnn-05bfbd34ec06c2dc3b0c89f0ede5de587cdbb3a2.tar.gz
IVGCVSW-3454 Fix VTS dilated conv2d test failures
* Updated InferOutputShapes to take dilation into account Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I84e999dc037fa47ce5290e9baa0df94bc9e7ce4d
-rw-r--r--src/armnn/layers/Convolution2dLayer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/armnn/layers/Convolution2dLayer.cpp b/src/armnn/layers/Convolution2dLayer.cpp
index 243bcc3dfd..2c7a570790 100644
--- a/src/armnn/layers/Convolution2dLayer.cpp
+++ b/src/armnn/layers/Convolution2dLayer.cpp
@@ -69,11 +69,13 @@ std::vector<TensorShape> Convolution2dLayer::InferOutputShapes(const std::vector
unsigned int inBatchSize = inputShape[0];
unsigned int filterWidth = filterShape[dataLayoutIndex.GetWidthIndex()];
- unsigned int readWidth = (inWidth + m_Param.m_PadLeft + m_Param.m_PadRight) - (filterWidth);
- unsigned int outWidth = 1 + (readWidth / m_Param.m_StrideX);
+ unsigned int dilatedFilterWidth = filterWidth + (m_Param.m_DilationX - 1) * (filterWidth - 1);
+ unsigned int readWidth = (inWidth + m_Param.m_PadLeft + m_Param.m_PadRight) - dilatedFilterWidth;
+ unsigned int outWidth = 1 + (readWidth / m_Param.m_StrideX);
unsigned int filterHeight = filterShape[dataLayoutIndex.GetHeightIndex()];
- unsigned int readHeight = (inHeight + m_Param.m_PadTop + m_Param.m_PadBottom) - (filterHeight);
+ unsigned int dilatedFilterHeight = filterHeight + (m_Param.m_DilationY - 1) * (filterHeight - 1);
+ unsigned int readHeight = (inHeight + m_Param.m_PadTop + m_Param.m_PadBottom) - dilatedFilterHeight;
unsigned int outHeight = 1 + (readHeight / m_Param.m_StrideY);
unsigned int outChannels = filterShape[0];