IVGCVSW-7676 Audit the use of ARMNN_ASSERT
* Replace most ARMNN_ASSERT's from tflite parser
* Replace most ARMNN_ASSERT's from onnx parser
* Replace some ARMNN_ASSERT's from tflite delegate
* Replace some ARMNN_ASSERT;s from include files
Signed-off-by: Ryan OShea <ryan.oshea3@arm.com>
Change-Id: Ie052e0180060203f28f64ebf54acad298f431caf
diff --git a/delegate/opaque/src/Split.hpp b/delegate/opaque/src/Split.hpp
index aec0fb6..2dbfa60 100644
--- a/delegate/opaque/src/Split.hpp
+++ b/delegate/opaque/src/Split.hpp
@@ -68,7 +68,11 @@
const armnn::TensorInfo& inputTensorInfo = GetTensorInfoForTfLiteOpaqueTensor(tfLiteInputTensor);
- ARMNN_ASSERT(GetTensorInfoForTfLiteOpaqueTensor(tfLiteAxisTensor).GetNumElements() == 1);
+ if (GetTensorInfoForTfLiteOpaqueTensor(tfLiteAxisTensor).GetNumElements() != 1)
+ {
+ return kTfLiteError;
+ }
+
auto* axisTensorDataPtr = static_cast<uint32_t*>(TfLiteOpaqueTensorData(tfLiteAxisTensor));
std::vector<int32_t> axisTensorData(axisTensorDataPtr, axisTensorDataPtr + 1);
int32_t axis = axisTensorData[0];
@@ -230,8 +234,16 @@
const armnn::TensorInfo& inputTensorInfo = GetTensorInfoForTfLiteOpaqueTensor(tfLiteInputTensor);
const armnn::TensorInfo& splitsTensorInfo = GetTensorInfoForTfLiteOpaqueTensor(tfLiteSplitsTensor);
- ARMNN_ASSERT(splitsTensorInfo.GetNumDimensions() == 1);
- ARMNN_ASSERT(GetTensorInfoForTfLiteOpaqueTensor(tfLiteAxisTensor).GetNumElements() == 1);
+
+ if (splitsTensorInfo.GetNumDimensions() != 1)
+ {
+ return kTfLiteError;
+ }
+
+ if (GetTensorInfoForTfLiteOpaqueTensor(tfLiteAxisTensor).GetNumElements() != 1)
+ {
+ return kTfLiteError;
+ }
auto* axisTensorDataPtr = static_cast<uint32_t*>(TfLiteOpaqueTensorData(tfLiteAxisTensor));
std::vector<int32_t> axisTensorData(axisTensorDataPtr, axisTensorDataPtr + 1);