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
diff --git a/delegate/src/Redefine.hpp b/delegate/src/Redefine.hpp
index 8f9a4e4..864fb7a 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 @@
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 @@
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);
}