aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backendsCommon/WorkloadUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/backends/backendsCommon/WorkloadUtils.cpp')
-rw-r--r--src/backends/backendsCommon/WorkloadUtils.cpp4
1 files changed, 3 insertions, 1 deletions
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<TensorInfo, unsigned int> 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 };