IVGCVSW-4302 Depthwise CTS. Fix ReorderWeightChannelsForAcl.
authorTeresa Charlin <teresa.charlinreyes@arm.com>
Wed, 18 Dec 2019 22:10:47 +0000 (22:10 +0000)
committerTeresa Charlin <teresa.charlinreyes@arm.com>
Wed, 18 Dec 2019 22:10:47 +0000 (22:10 +0000)
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: I8d2050f4478fe9d9cdf9e374b8906827cc769689

src/backends/backendsCommon/WorkloadUtils.cpp

index 0cf8ad1..1a45a9f 100644 (file)
@@ -86,17 +86,12 @@ ConstTensor ReorderWeightChannelsForAcl(const ConstTensor& weightHandle, DataLay
     unsigned int destinationWeightsChannel;
     unsigned int totalChannels = inputChannels * multiplier;
     unsigned int channelSize   = height * width;
+    unsigned int inputChannel  = 0;
 
     for (unsigned int originWeightsChannel = 0; originWeightsChannel < totalChannels; originWeightsChannel++)
     {
-        if (originWeightsChannel % inputChannels == 0)
-        {
-            destinationWeightsChannel = originWeightsChannel / inputChannels;
-        }
-        else
-        {
-            destinationWeightsChannel = (originWeightsChannel - 1) / inputChannels + multiplier;
-        }
+        inputChannel = originWeightsChannel % inputChannels;
+        destinationWeightsChannel = (originWeightsChannel - inputChannel) / inputChannels + multiplier * inputChannel;
 
         for (unsigned int i = 0; i < channelSize; i++)
         {