From 3d1059c5b782c5014fe790194b7dd91d2df66c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89anna=20=C3=93=20Cath=C3=A1in?= Date: Thu, 11 Oct 2018 15:53:04 +0100 Subject: IVGCVSW-1930: Simplifying the driver conversion function for Pooling2d, removing the conversion to splitter layer if pool is 1x1. Change-Id: Iea3af08652dd6fd1e6820ef43d9101d38c230b5e --- ConversionUtils.hpp | 45 +++++++++------------------------------------ 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/ConversionUtils.hpp b/ConversionUtils.hpp index 165c63b7..783f7cec 100644 --- a/ConversionUtils.hpp +++ b/ConversionUtils.hpp @@ -985,47 +985,20 @@ bool ConvertPooling2d(const HalOperation& operation, } } - // ArmNN does not accept a pool size of 1, but the ArmNN driver is expected to cope. - // This is mapped to a trivial splitter instead. armnn::IConnectableLayer* startLayer = nullptr; - if (desc.m_PoolWidth != 1 || desc.m_PoolHeight != 1) - { - if (!IsLayerSupported(__func__, - armnn::IsPooling2dSupported, - data.m_Compute, - swizzledInputInfo, - swizzledOutputInfo, - desc)) - { - return false; - } - startLayer = data.m_Network->AddPooling2dLayer(desc); - } - else + if (!IsLayerSupported(__func__, + armnn::IsPooling2dSupported, + data.m_Compute, + swizzledInputInfo, + swizzledOutputInfo, + desc)) { - const unsigned int numDims = swizzledOutputInfo.GetNumDimensions(); - - armnn::ViewsDescriptor viewsDesc(1, numDims); - - for (unsigned int i = 0; i < numDims; ++i) - { - viewsDesc.SetViewOriginCoord(0, i, 0); - viewsDesc.SetViewSize(0, i, swizzledOutputInfo.GetShape()[i]); - } - - if (!IsLayerSupported(__func__, - armnn::IsSplitterSupported, - data.m_Compute, - swizzledInputInfo, - viewsDesc)) - { - return false; - } - - startLayer = data.m_Network->AddSplitterLayer(viewsDesc); + return false; } + startLayer = data.m_Network->AddPooling2dLayer(desc); + armnn::IConnectableLayer* endLayer = ProcessActivation(swizzledOutputInfo, activation, startLayer, data); if (endLayer != nullptr) -- cgit v1.2.1