diff options
author | Ryan OShea <ryan.oshea3@arm.com> | 2023-01-17 15:19:20 +0000 |
---|---|---|
committer | Ryan OShea <ryan.oshea3@arm.com> | 2023-02-03 10:31:10 +0000 |
commit | 4c231de93b9b7c2af24e155550cb80b96f2c4bb5 (patch) | |
tree | fcbc43d7436cacc63ef7a90e73023135694ddf48 /delegate/src/Redefine.hpp | |
parent | 555dc0982f85f0a146e99189bac523151797a056 (diff) | |
download | armnn-4c231de93b9b7c2af24e155550cb80b96f2c4bb5.tar.gz |
IVGCVSW-7501 Allow constant tensors as inputs for input data in the delegate
In the TLCT tests we were failing many tests because they used
constant tensors as data input for the layers. We had the functionality
in place but we didnt have it spread across the visit functions.
* Check if inputs are constant tensors and attempt to assign them
to input slot of layers.
* Add missing checks to some functions that return a kTfLiteStatus
so we can see if they fail
* Clean up CreateConstTensor function
Signed-off-by: Ryan OShea <ryan.oshea3@arm.com>
Change-Id: I8610b770aea56932a98f91c961d59b3de47c2ab5
Diffstat (limited to 'delegate/src/Redefine.hpp')
-rw-r--r-- | delegate/src/Redefine.hpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/delegate/src/Redefine.hpp b/delegate/src/Redefine.hpp index 8f9a4e4ba0..864fb7af67 100644 --- a/delegate/src/Redefine.hpp +++ b/delegate/src/Redefine.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -74,6 +74,12 @@ TfLiteStatus VisitCastOperator(DelegateData& delegateData, armnn::IOutputSlot& outputSlot = layer->GetOutputSlot(0); outputSlot.SetTensorInfo(outputTensorInfo); + // try to connect the Constant Inputs if there are any + if(ProcessInputs(layer,delegateData, tfLiteContext, tfLiteNode) != kTfLiteOk ) + { + return kTfLiteError; + } + // Connect return Connect(layer, tfLiteNode, delegateData); } @@ -240,6 +246,12 @@ TfLiteStatus VisitReshapeOperator(DelegateData& delegateData, armnn::IOutputSlot& outputSlot = layer->GetOutputSlot(0); outputSlot.SetTensorInfo(outputTensorInfo); + // try to connect the Constant Inputs if there are any + if(ProcessInputs(layer,delegateData, tfLiteContext, tfLiteNode) != kTfLiteOk ) + { + return kTfLiteError; + } + // Connect return Connect(layer, tfLiteNode, delegateData); } |