diff options
Diffstat (limited to 'delegate/src/DelegateUtils.hpp')
-rw-r--r-- | delegate/src/DelegateUtils.hpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/delegate/src/DelegateUtils.hpp b/delegate/src/DelegateUtils.hpp index e0ba1cf4e7..46b2db9d64 100644 --- a/delegate/src/DelegateUtils.hpp +++ b/delegate/src/DelegateUtils.hpp @@ -586,11 +586,13 @@ TfLiteStatus ConnectConstant(armnn::IConnectableLayer* layer, bool IsOptionalOperandPresent(TfLiteNode* tfLiteNode, const int operandIndex) { - if (tfLiteNode->inputs->data[operandIndex] < 0) { + // If the inputs array has fewer than operandIndex entries or if the entry at operandIndex has a value of -1 or + // less then the input is not present. + if (tfLiteNode->inputs->size > operandIndex && tfLiteNode->inputs->data[operandIndex] >= 0) + { return true; } return false; - } TfLiteStatus ProcessInputs(armnn::IConnectableLayer* layer, |