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/Convolution.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/Convolution.hpp')
-rw-r--r-- | delegate/opaque/src/Convolution.hpp | 60 |
1 files changed, 2 insertions, 58 deletions
diff --git a/delegate/opaque/src/Convolution.hpp b/delegate/opaque/src/Convolution.hpp index 163290b542..50c57d1d1f 100644 --- a/delegate/opaque/src/Convolution.hpp +++ b/delegate/opaque/src/Convolution.hpp @@ -47,31 +47,11 @@ TfLiteStatus VisitConv2dOperator(DelegateData& delegateData, { return kTfLiteError; } - if (IsDynamicTensor(tfLiteInputTensor)) - { - TF_LITE_OPAQUE_MAYBE_KERNEL_LOG( - tfLiteContext, - "TfLiteArmnnOpaqueDelegate: Dynamic input tensors are not supported in operator #%d node #%d: ", - operatorCode, nodeIndex); - return kTfLiteError; - } // Use input indices to get filter tensor. const TfLiteOpaqueTensor* tfLiteFilterTensor = TfLiteOpaqueContextGetOpaqueTensor(tfLiteContext, inputTensors[1]); - if(!IsValid(tfLiteFilterTensor)) - { - TF_LITE_OPAQUE_MAYBE_KERNEL_LOG( - tfLiteContext, - "TfLiteArmnnOpaqueDelegate: Invalid filter tensor in operator #%d node #%d: ", - operatorCode, nodeIndex); - return kTfLiteError; - } - if (IsDynamicTensor(tfLiteFilterTensor)) + if (!IsValid(tfLiteContext, tfLiteFilterTensor, operatorCode, nodeIndex)) { - TF_LITE_OPAQUE_MAYBE_KERNEL_LOG( - tfLiteContext, - "TfLiteArmnnOpaqueDelegate: Dynamic filter tensors are not supported in node #%d: ", - nodeIndex); return kTfLiteError; } @@ -92,14 +72,6 @@ TfLiteStatus VisitConv2dOperator(DelegateData& delegateData, { return kTfLiteError; } - if (IsDynamicTensor(tfLiteOutputTensor)) - { - TF_LITE_OPAQUE_MAYBE_KERNEL_LOG( - tfLiteContext, - "TfLiteArmnnOpaqueDelegate: Dynamic output tensors are not supported in operator #%d node #%d: ", - operatorCode, nodeIndex); - return kTfLiteError; - } const armnn::TensorInfo& inputTensorInfo = GetTensorInfoForTfLiteOpaqueTensor(tfLiteInputTensor); const armnn::TensorInfo& filterTensorInfo = GetTensorInfoForTfLiteOpaqueTensor(tfLiteFilterTensor); @@ -281,31 +253,11 @@ TfLiteStatus VisitDepthwiseConv2dOperator(DelegateData& delegateData, { return kTfLiteError; } - if (IsDynamicTensor(tfLiteInputTensor)) - { - TF_LITE_OPAQUE_MAYBE_KERNEL_LOG( - tfLiteContext, - "TfLiteArmnnOpaqueDelegate: Dynamic input tensors are not supported in operator #%d node #%d: ", - operatorCode, nodeIndex); - return kTfLiteError; - } // Use input indices to get filter tensor. const TfLiteOpaqueTensor* tfLiteFilterTensor = TfLiteOpaqueContextGetOpaqueTensor(tfLiteContext, inputTensors[1]); - if(!IsValid(tfLiteFilterTensor)) - { - TF_LITE_OPAQUE_MAYBE_KERNEL_LOG( - tfLiteContext, - "TfLiteArmnnOpaqueDelegate: Invalid filter tensor in operator #%d node #%d: ", - operatorCode, nodeIndex); - return kTfLiteError; - } - if (IsDynamicTensor(tfLiteFilterTensor)) + if (!IsValid(tfLiteContext, tfLiteFilterTensor, operatorCode, nodeIndex)) { - TF_LITE_OPAQUE_MAYBE_KERNEL_LOG( - tfLiteContext, - "TfLiteArmnnOpaqueDelegate: Dynamic filter tensors are not supported in node #%d: ", - nodeIndex); return kTfLiteError; } @@ -326,14 +278,6 @@ TfLiteStatus VisitDepthwiseConv2dOperator(DelegateData& delegateData, { return kTfLiteError; } - if (IsDynamicTensor(tfLiteOutputTensor)) - { - TF_LITE_OPAQUE_MAYBE_KERNEL_LOG( - tfLiteContext, - "TfLiteArmnnOpaqueDelegate: Dynamic output tensors are not supported in operator #%d node #%d: ", - operatorCode, nodeIndex); - return kTfLiteError; - } const armnn::TensorInfo& inputTensorInfo = GetTensorInfoForTfLiteOpaqueTensor(tfLiteInputTensor); const armnn::TensorInfo& filterTensorInfo = GetTensorInfoForTfLiteOpaqueTensor(tfLiteFilterTensor); |