aboutsummaryrefslogtreecommitdiff
path: root/ConversionUtils_1_2.hpp
diff options
context:
space:
mode:
authorJan Eilers <jan.eilers@arm.com>2021-04-27 09:21:08 +0100
committerJan Eilers <jan.eilers@arm.com>2021-06-12 12:08:09 +0100
commita20d2b8756fb0dea15b1f7620072e510f4977aeb (patch)
tree00c0a801c7f14b6be1e29f07e85b99a096aac54d /ConversionUtils_1_2.hpp
parent9150bff63a690caa743c471943afe509ebed1044 (diff)
downloadandroid-nn-driver-a20d2b8756fb0dea15b1f7620072e510f4977aeb.tar.gz
IVGCVSW-5826 Change weights layout for depthwise to [1,H,W,I*M]
!armnn:5552 Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I5bbc998f1a29030f718d85b646907c5a314ceecf
Diffstat (limited to 'ConversionUtils_1_2.hpp')
-rw-r--r--ConversionUtils_1_2.hpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/ConversionUtils_1_2.hpp b/ConversionUtils_1_2.hpp
index eec87bf5..f884f7c0 100644
--- a/ConversionUtils_1_2.hpp
+++ b/ConversionUtils_1_2.hpp
@@ -467,22 +467,12 @@ bool ConvertDepthwiseConv2d_1_2(const HalOperation& operation, const HalModel& m
unsigned int widthIndex = dataLayoutIndexed.GetWidthIndex();
unsigned int heightIndex = dataLayoutIndexed.GetHeightIndex();
- // Reinterpret weight data as [ H, W, I, M ]
- TensorShape weightsShape({ weightsOperand->dimensions[1],
- weightsOperand->dimensions[2],
- inputInfo.GetShape()[channelsIndex],
- weightsOperand->dimensions[3] / inputInfo.GetShape()[channelsIndex] });
-
- // Swizzle weight data [ H, W, I, M ] -> [ M, I, H, W ]
- const PermutationVector HWIMToMIHW = { 2U, 3U, 1U, 0U };
-
+ // The layout for weights in depthwise is [ 1, H, W, O] and it's the same in ArmNN. No need to permute anything.
const ConstTensorPin weightsPin =
ConvertOperationInputToConstTensorPin<HalPolicy>(operation,
1,
model,
- data,
- HWIMToMIHW,
- &weightsShape);
+ data);
// Bias is a 1D tensor
const ConstTensorPin biasPin =
@@ -516,8 +506,8 @@ bool ConvertDepthwiseConv2d_1_2(const HalOperation& operation, const HalModel& m
return Fail("%s: Operation has invalid inputs (implicit padding)", __func__);
}
- const uint32_t kernelX = weights.GetShape()[3];
- const uint32_t kernelY = weights.GetShape()[2];
+ const uint32_t kernelX = weights.GetShape()[2];
+ const uint32_t kernelY = weights.GetShape()[1];
const uint32_t inputX = inputInfo.GetShape()[widthIndex];
const uint32_t inputY = inputInfo.GetShape()[heightIndex];