diff options
Diffstat (limited to 'delegate/src/DelegateUtils.hpp')
-rw-r--r-- | delegate/src/DelegateUtils.hpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/delegate/src/DelegateUtils.hpp b/delegate/src/DelegateUtils.hpp index 2d1651842a..8c7ba25e15 100644 --- a/delegate/src/DelegateUtils.hpp +++ b/delegate/src/DelegateUtils.hpp @@ -506,6 +506,13 @@ armnn::ConstTensor CreateConstTensor(const TfLiteTensor* tfLiteTensor, } } +armnn::ConstTensor* GetConstTensorForTfLiteTensor(const TfLiteTensor* tfLiteTensors, TfLiteNode* tfLiteNode, int index) +{ + const TfLiteTensor &tfLiteTensor = tfLiteTensors[tfLiteNode->inputs->data[index]]; + armnn::TensorInfo tensorInfo = GetTensorInfoForTfLiteTensor(tfLiteTensor); + return new armnn::ConstTensor(tensorInfo, tfLiteTensor.data.data); +} + void CalcPadding(uint32_t inputSize, uint32_t filterSize, uint32_t stride, @@ -561,6 +568,15 @@ TfLiteStatus ConnectConstant(armnn::IConnectableLayer* layer, return kTfLiteOk; } +bool IsOptionalOperandPresent(TfLiteNode* tfLiteNode, const int operandIndex) +{ + if (tfLiteNode->inputs->data[operandIndex] < 0) { + return true; + } + return false; + +} + TfLiteStatus ProcessInputs(armnn::IConnectableLayer* layer, armnnDelegate::DelegateData& delegateData, TfLiteContext* tfLiteContext, |