aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/workloads/ConvImpl.cpp
diff options
context:
space:
mode:
authorFinn Williams <Finn.Williams@arm.com>2020-09-29 19:54:00 +0100
committerTeresaARM <teresa.charlinreyes@arm.com>2020-10-01 07:57:12 +0000
commitea8ce7040476da46e145705b0b08e9449144a3b2 (patch)
treed6d09864e689a11e206ebfdd738d0191d06f6e91 /src/backends/reference/workloads/ConvImpl.cpp
parent6d9f5c57fe80b3b3c08294ddd52062e107151a15 (diff)
downloadarmnn-ea8ce7040476da46e145705b0b08e9449144a3b2.tar.gz
IVGCVSW-5325 Fix non-channel per axis quantization
Signed-off-by: Finn Williams <Finn.Williams@arm.com> Change-Id: Ie0cf69b2cd76d6ecedab43d3d9ae267d23bbc052
Diffstat (limited to 'src/backends/reference/workloads/ConvImpl.cpp')
-rw-r--r--src/backends/reference/workloads/ConvImpl.cpp27
1 files changed, 4 insertions, 23 deletions
diff --git a/src/backends/reference/workloads/ConvImpl.cpp b/src/backends/reference/workloads/ConvImpl.cpp
index f11c351c61..d7845535df 100644
--- a/src/backends/reference/workloads/ConvImpl.cpp
+++ b/src/backends/reference/workloads/ConvImpl.cpp
@@ -108,30 +108,11 @@ void Convolve(const TensorShape& rInputShape,
const unsigned int filterHeight = depthwise ? rFilterShape[2] : rFilterShape[heightIndex];
const unsigned int filterWidth = depthwise ? rFilterShape[3] : rFilterShape[widthIndex];
- const std::vector<float> inputVec = rInputDecoder.DecodeTensor(rInputShape.GetNumElements());
+ const std::vector<float> inputVec = rInputDecoder.DecodeTensor(rInputShape);
+ const std::vector<float> filterVec = rFilterDecoder.DecodeTensor(rFilterShape, depthMultiplier, depthwise);
- uint32_t channelStepSize;
- if (depthwise)
- {
- channelStepSize = filterHeight * filterWidth;
- }
- else
- {
- if (dataLayoutIndexed.GetDataLayout() == DataLayout::NHWC)
- {
- channelStepSize = rFilterShape[3];
- }
- else
- {
- channelStepSize = rFilterShape[1] * rFilterShape[2] * rFilterShape[3];
- }
- }
-
- const std::vector<float> filterVec = rFilterDecoder.DecodeTensor(rFilterShape.GetNumElements(),
- channelStepSize,
- depthMultiplier);
- const std::vector<float> biasVec = biasEnabled ?
- pBiasDecoder->DecodeTensor(outputChannels) : std::vector<float>();
+ const TensorShape biasShape{outputChannels};
+ const std::vector<float> biasVec = biasEnabled ? pBiasDecoder->DecodeTensor(biasShape) : std::vector<float>();
unsigned int depthwiseMultiplierIdx = 0;
for (unsigned int batchIdx = 0; batchIdx < batchSize; batchIdx++)