aboutsummaryrefslogtreecommitdiff
path: root/src/armnnUtils/TensorUtils.cpp
diff options
context:
space:
mode:
authorAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-11-05 18:00:21 +0000
committerFrancis Murtagh <francis.murtagh@arm.com>2019-11-06 12:10:02 +0000
commit5edc8816118fcddb2681379db04c978041ce8b46 (patch)
tree22e4382138e9963d0ed3dacefda4fb142877e1fc /src/armnnUtils/TensorUtils.cpp
parentec33a91ec1557b78b2d01975ec4c5eaf24aa058c (diff)
downloadarmnn-5edc8816118fcddb2681379db04c978041ce8b46.tar.gz
IVGCVSW-3837 Add support for per-axis quantization to reference Convolution2d workload
Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> Change-Id: I0ac08ba4864d48e6f64c4ac645dad8ea850be112
Diffstat (limited to 'src/armnnUtils/TensorUtils.cpp')
-rw-r--r--src/armnnUtils/TensorUtils.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/armnnUtils/TensorUtils.cpp b/src/armnnUtils/TensorUtils.cpp
index 630490ff14..601277491c 100644
--- a/src/armnnUtils/TensorUtils.cpp
+++ b/src/armnnUtils/TensorUtils.cpp
@@ -142,7 +142,7 @@ unsigned int GetNumElementsAfter(const armnn::TensorShape& shape, unsigned int a
{
unsigned int numDim = shape.GetNumDimensions();
BOOST_ASSERT(0 >= axis);
- BOOST_ASSERT(axis < numDim - 1);
+ BOOST_ASSERT(axis <= numDim - 1);
unsigned int count = 1;
for (unsigned int i = axis; i < numDim; i++)
{
@@ -155,7 +155,7 @@ std::pair<unsigned int, std::vector<float>> GetPerAxisParams(const armnn::Tensor
{
const std::vector<float>& scales = info.GetQuantizationScales();
armnn::Optional<unsigned int> quantizationDim = info.GetQuantizationDim();
- if (scales.size() < 1 || !quantizationDim.has_value())
+ if (!info.HasPerAxisQuantization())
{
throw armnn::InvalidArgumentException(
std::string("Per-axis quantization params not set for tensor of type ") +
@@ -166,5 +166,4 @@ std::pair<unsigned int, std::vector<float>> GetPerAxisParams(const armnn::Tensor
return { axisFactor, scales };
}
-
} // namespace armnnUtils