aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/layers/StridedSliceLayer.cpp
diff options
context:
space:
mode:
authorDavid Monahan <david.monahan@arm.com>2020-03-31 12:19:57 +0100
committerDavid Monahan <david.monahan@arm.com>2020-04-01 12:58:45 +0000
commit7a7ca576d117b0f433ddb796de3dbcb96a3bb991 (patch)
tree1aced83475b797f5729b559e951c7677f94c081d /src/armnn/layers/StridedSliceLayer.cpp
parent5c6275a60350a784562210b37a763f27524851a8 (diff)
downloadarmnn-7a7ca576d117b0f433ddb796de3dbcb96a3bb991.tar.gz
IVGCVSW-4531 Tweak to an existing fix for failing NNT tests on Android R
HAL 1.1/1.2 to account for negative slices Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: Ia98101b07b826359fb621b801fcbc811d7ec6f6a
Diffstat (limited to 'src/armnn/layers/StridedSliceLayer.cpp')
-rw-r--r--src/armnn/layers/StridedSliceLayer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/armnn/layers/StridedSliceLayer.cpp b/src/armnn/layers/StridedSliceLayer.cpp
index dd4f942086..c31b9a4280 100644
--- a/src/armnn/layers/StridedSliceLayer.cpp
+++ b/src/armnn/layers/StridedSliceLayer.cpp
@@ -58,11 +58,12 @@ std::vector<TensorShape> StridedSliceLayer::InferOutputShapes(
if (m_Param.m_ShrinkAxisMask & (1 << i))
{
- // Don't take a slice from an axis being shrunk
- if (m_Param.m_End[i] >= 2)
+ // If the difference between the start point and the end point of the slice on an axis being shrunk
+ // is greater than 1 then throw an error as the output will not be large enough to hold the slice
+ if (((m_Param.m_Begin[i] - m_Param.m_End[i]) > 1) || ((m_Param.m_Begin[i] - m_Param.m_End[i]) < -1))
{
throw LayerValidationException(
- "StridedSlice: Attempting to take slice from an axis being shrunk");
+ "StridedSlice: Attempting to take a larger slice than can fit in inferred output");
}
continue;
}