diff options
author | Matthew Sloyan <matthew.sloyan@arm.com> | 2023-04-26 11:42:46 +0100 |
---|---|---|
committer | Matthew Sloyan <matthew.sloyan@arm.com> | 2023-04-26 11:36:49 +0000 |
commit | 2b04ec3b94da152281fbbc69f8539378589b1f56 (patch) | |
tree | 13fd9f3a8ca44cf4f3a53ccf3f44960cfe627475 /delegate/opaque/src/OpaqueDelegateUtils.hpp | |
parent | f2dffdb00bdf3108ebda6aaa142249d208f0c507 (diff) | |
download | armnn-2b04ec3b94da152281fbbc69f8539378589b1f56.tar.gz |
IVGCVSW-7579 IVGCVSW-7581 IVGCVSW-7583 Implement Comparison, Concat and Mean in Opaque Delegate
* Removed input slot check from Connect function as number of TFLite
and Arm NN inputs can differ.
* Moved SetupConcatViewOrigin function to DelegateUtils.hpp
* Simplified validation checks in VistConvolution functions as IsValid
and IsDynamic were already being called.
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Change-Id: I858dbe4b643f9d350d9c38ea255ce5effbda4612
Diffstat (limited to 'delegate/opaque/src/OpaqueDelegateUtils.hpp')
-rw-r--r-- | delegate/opaque/src/OpaqueDelegateUtils.hpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/delegate/opaque/src/OpaqueDelegateUtils.hpp b/delegate/opaque/src/OpaqueDelegateUtils.hpp index 688c683fa8..1fbfade038 100644 --- a/delegate/opaque/src/OpaqueDelegateUtils.hpp +++ b/delegate/opaque/src/OpaqueDelegateUtils.hpp @@ -139,7 +139,7 @@ bool IsValid(TfLiteOpaqueContext* tfLiteContext, { TF_LITE_OPAQUE_MAYBE_KERNEL_LOG( tfLiteContext, - "TfLiteArmnnDelegate: Invalid TfLite tensor in operator #%d node #%d: ", + "TfLiteArmnnOpaqueDelegate: Invalid TfLite tensor in operator #%d node #%d: ", operatorCode, nodeIndex); return false; } @@ -147,7 +147,7 @@ bool IsValid(TfLiteOpaqueContext* tfLiteContext, { TF_LITE_OPAQUE_MAYBE_KERNEL_LOG( tfLiteContext, - "TfLiteArmnnDelegate: Dynamic tensors are not supported in operator #%d node #%d: ", + "TfLiteArmnnOpaqueDelegate: Dynamic tensors are not supported in operator #%d node #%d: ", operatorCode, nodeIndex); return false; } @@ -179,13 +179,10 @@ TfLiteStatus Connect(armnn::IConnectableLayer* layer, { return kTfLiteError; } - // numInputs is set from TfLiteOpaqueNodeInputs. - if(numInputs != static_cast<int>(layer->GetNumInputSlots())) - { - ARMNN_LOG(error) << "Layer: " << layer->GetName() << ": Expected number of input slots does not match actual " - "number of input slots."; - return kTfLiteError; - } + // We can't validate the number of inputs vs the layer->GetNumOutputSlots() as some operators differ. + // An example is Mean where the number of TFLite inputs is 2, but number of Arm NN inputs is 1, + // as we store the axis within the descriptor. + // Connect the input slots. // For each input slot, get the index of the opaque tensor that was allocated for it. for (unsigned int inputIndex = 0; inputIndex < layer->GetNumInputSlots(); ++inputIndex) |