aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/layers/AbsLayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnn/layers/AbsLayer.cpp')
-rw-r--r--src/armnn/layers/AbsLayer.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/armnn/layers/AbsLayer.cpp b/src/armnn/layers/AbsLayer.cpp
index 6858b364a6..67654ac8b6 100644
--- a/src/armnn/layers/AbsLayer.cpp
+++ b/src/armnn/layers/AbsLayer.cpp
@@ -1,5 +1,5 @@
//
-// Copyright © 2017,2019-2023 Arm Ltd and Contributors. All rights reserved.
+// Copyright © 2017,2019-2024 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
@@ -42,7 +42,12 @@ void AbsLayer::ValidateTensorShapesFromInputs()
auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetTensorInfo().GetShape() });
- ARMNN_ASSERT(inferredShapes.size() == 1);
+ if (inferredShapes.size() != 1)
+ {
+ throw armnn::LayerValidationException("inferredShapes has "
+ + std::to_string(inferredShapes.size()) +
+ " elements - should only have 1.");
+ }
ValidateAndCopyShape(outputShape, inferredShapes[0], m_ShapeInferenceMethod, "AbsLayer");
}
@@ -52,4 +57,4 @@ void AbsLayer::ExecuteStrategy(IStrategy &strategy) const
strategy.ExecuteStrategy(this, GetParameters(), {}, GeName());
}
-} // namespace armnn \ No newline at end of file
+} // namespace armnn