IVGCVSW-1930: Simplifying the driver conversion function for Pooling2d,
removing the conversion to splitter layer if pool is 1x1.
Change-Id: Iea3af08652dd6fd1e6820ef43d9101d38c230b5e
diff --git a/ConversionUtils.hpp b/ConversionUtils.hpp
index 165c63b..783f7ce 100644
--- a/ConversionUtils.hpp
+++ b/ConversionUtils.hpp
@@ -985,46 +985,19 @@
}
}
- // 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))
{
- if (!IsLayerSupported(__func__,
- armnn::IsPooling2dSupported,
- data.m_Compute,
- swizzledInputInfo,
- swizzledOutputInfo,
- desc))
- {
- return false;
- }
-
- startLayer = data.m_Network->AddPooling2dLayer(desc);
+ return false;
}
- else
- {
- 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);
- }
+ startLayer = data.m_Network->AddPooling2dLayer(desc);
armnn::IConnectableLayer* endLayer = ProcessActivation(swizzledOutputInfo, activation, startLayer, data);