diff options
author | Ryan OShea <Ryan.OShea2@arm.com> | 2020-07-03 11:40:12 +0100 |
---|---|---|
committer | Ryan O'Shea <ryan.oshea2@arm.com> | 2020-07-06 15:40:21 +0000 |
commit | b7c1831f95a5ecdde0fff068d4054a066309cec6 (patch) | |
tree | 7bcf8c801c5a6e498821c29b2298324689f647b8 | |
parent | 0ad3ef15b7b731e9b722123f8763b2f1e3783cb8 (diff) | |
download | armnn-b7c1831f95a5ecdde0fff068d4054a066309cec6.tar.gz |
IVGCVSW-4920 Invalid Negative Stride fix
* Add check for negative stride with ShrinkAxisMask
Signed-off-by: Ryan OShea <Ryan.OShea2@arm.com>
Change-Id: I69ecd2915d94278d6313d8279361c4dc675adb74
-rw-r--r-- | src/armnn/layers/StridedSliceLayer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/armnn/layers/StridedSliceLayer.cpp b/src/armnn/layers/StridedSliceLayer.cpp index 2609b94d91..ae4fab0efd 100644 --- a/src/armnn/layers/StridedSliceLayer.cpp +++ b/src/armnn/layers/StridedSliceLayer.cpp @@ -65,6 +65,12 @@ std::vector<TensorShape> StridedSliceLayer::InferOutputShapes( throw LayerValidationException( "StridedSlice: Attempting to take a larger slice than can fit in inferred output"); } + + if (stride < 0) + { + throw LayerValidationException( + "StridedSlice: Stride can not be negative with Shrink Axis Mask set."); + } continue; } |