aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/layers/TileLayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnn/layers/TileLayer.cpp')
-rw-r--r--src/armnn/layers/TileLayer.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/armnn/layers/TileLayer.cpp b/src/armnn/layers/TileLayer.cpp
index d3629002e0..8e07478a54 100644
--- a/src/armnn/layers/TileLayer.cpp
+++ b/src/armnn/layers/TileLayer.cpp
@@ -1,5 +1,5 @@
//
-// Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
+// Copyright © 2023-2024 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
@@ -31,7 +31,12 @@ TileLayer* TileLayer::Clone(armnn::Graph &graph) const
std::vector<TensorShape> TileLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const
{
- ARMNN_ASSERT(inputShapes.size() == 1);
+ if (inputShapes.size() != 1)
+ {
+ throw armnn::Exception("inputShapes' size is \"" + std::to_string(inputShapes.size()) +
+ "\" - should be \"1\".");
+ }
+
const TensorShape& inputShape = inputShapes[0];
uint32_t numberOfDimensions = inputShape.GetNumDimensions();
@@ -64,9 +69,14 @@ void TileLayer::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, "TileLayer");
}
-} \ No newline at end of file
+}