aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉanna Ó Catháin <eanna.ocathain@arm.com>2018-10-11 15:53:04 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2018-10-22 17:25:39 +0100
commit3d1059c5b782c5014fe790194b7dd91d2df66c84 (patch)
tree0a05c0040f323600d837bde94833608c0a071d4d
parentb847148f5d97f0514098414c010f764da3f75af6 (diff)
downloadandroid-nn-driver-3d1059c5b782c5014fe790194b7dd91d2df66c84.tar.gz
IVGCVSW-1930: Simplifying the driver conversion function for Pooling2d,
removing the conversion to splitter layer if pool is 1x1. Change-Id: Iea3af08652dd6fd1e6820ef43d9101d38c230b5e
-rw-r--r--ConversionUtils.hpp45
1 files 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)