From 4b19d2249e3b8f9216ec5b410fad20c41b4c6053 Mon Sep 17 00:00:00 2001 From: Cathal Corbett Date: Wed, 11 May 2022 20:12:17 +0100 Subject: IVGCVSW-6940 ConstTensorsAsInput: DepthwiseConvolution2d - Complete ACL * Added backend specific optimization & test for CpuAcc and GpuAcc: PermuteDepthwiseConv2dWeights Signed-off-by: Cathal Corbett Change-Id: I600476b2e9c557a39818a574c1091c9d650b21b1 --- src/backends/backendsCommon/WorkloadUtils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/backends/backendsCommon/WorkloadUtils.cpp') diff --git a/src/backends/backendsCommon/WorkloadUtils.cpp b/src/backends/backendsCommon/WorkloadUtils.cpp index d2ae16af0c..b045530abc 100644 --- a/src/backends/backendsCommon/WorkloadUtils.cpp +++ b/src/backends/backendsCommon/WorkloadUtils.cpp @@ -175,12 +175,14 @@ std::tuple Convert1HWOTensorInfoToAcl(const TensorInfo TensorInfo weightsPermuted; if (dataLayout == armnn::DataLayout::NHWC) { - // No permutation required. Data layouts are the same. + // No permutation required. Input and weights data layouts are the same. aclDepthMultiplier = weightInfo.GetShape()[3] / inputInfo.GetShape()[3]; weightsPermuted = weightInfo; } + else if (dataLayout == armnn::DataLayout::NCHW) { + // Weights permutation required. Weights [N,H,W,C] and input [N,C,H,W] data layouts are different. // [ 1, H, W, I*M] --> [ 1, I * M, H, W ] aclDepthMultiplier = weightInfo.GetShape()[3] / inputInfo.GetShape()[1]; PermutationVector permutationVector{ 0, 2, 3, 1 }; -- cgit v1.2.1