diff options
Diffstat (limited to 'src/backends/ArmComputeTensorUtils.hpp')
-rw-r--r-- | src/backends/ArmComputeTensorUtils.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/backends/ArmComputeTensorUtils.hpp b/src/backends/ArmComputeTensorUtils.hpp index 572e310ecf..18f41ee173 100644 --- a/src/backends/ArmComputeTensorUtils.hpp +++ b/src/backends/ArmComputeTensorUtils.hpp @@ -30,6 +30,16 @@ arm_compute::TensorShape BuildArmComputeTensorShape(const armnn::TensorShape& te /// armnn::ITensorInfo. arm_compute::TensorInfo BuildArmComputeTensorInfo(const armnn::TensorInfo& tensorInfo); +/// Utility function used to convert armnn::DataLayout to arm_compute::DataLayout +/// armnn::DataLayout. +arm_compute::DataLayout ConvertDataLayout(armnn::DataLayout dataLayout); + +/// Utility function used to setup an arm_compute::ITensorInfo object whose dimensions are based on the given +/// armnn::ITensorInfo. +/// armnn::DataLayout. +arm_compute::TensorInfo BuildArmComputeTensorInfo(const armnn::TensorInfo& tensorInfo, + armnn::DataLayout dataLayout); + /// Utility function used to setup an arm_compute::PoolingLayerInfo object from an armnn::Pooling2dDescriptor. arm_compute::PoolingLayerInfo BuildArmComputePoolingLayerInfo(const Pooling2dDescriptor& descriptor); @@ -59,6 +69,13 @@ void BuildArmComputeTensor(Tensor& tensor, const armnn::TensorInfo& tensorInfo) tensor.allocator()->init(BuildArmComputeTensorInfo(tensorInfo)); } +/// Sets up the given ArmCompute tensor's dimensions based on the given ArmNN tensor. +template <typename Tensor> +void BuildArmComputeTensor(Tensor& tensor, const armnn::TensorInfo& tensorInfo, DataLayout dataLayout) +{ + tensor.allocator()->init(BuildArmComputeTensorInfo(tensorInfo, dataLayout)); +} + template <typename Tensor> void InitialiseArmComputeTensorEmpty(Tensor& tensor) { |