aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/workloads/Decoders.hpp
diff options
context:
space:
mode:
authorKeith Davis <keith.davis@arm.com>2019-11-04 08:58:33 +0000
committerKeith Davis <keith.davis@arm.com>2019-11-04 16:46:35 +0000
commit5236e1d6bcff6ebec7ec10d7d416cc6ead5482dd (patch)
tree4152c5fcd6b9c11848a02dfa4ff8705a2cfae0a5 /src/backends/reference/workloads/Decoders.hpp
parentf71079328ae72a65c91e410b2bd35eabb67cb6d1 (diff)
downloadarmnn-5236e1d6bcff6ebec7ec10d7d416cc6ead5482dd.tar.gz
IVGCVSW-3835 Create Encoder and Decoder for QSymm8PerAxis
* Add QuantizedSymm8PerAxis to armnn DataType (types.hpp) and * Add Quantize and Dequantize template for int8 in TypeUtils to be able to compute QSymm8 of the weight * Create PerAxisIterator for per-axis quantization * Create QSymm8PerAxisDecoder * Create QSymm8PerAxisEncoder Signed-off-by: Keith Davis <keith.davis@arm.com> Change-Id: Ibcfe0288a197b7ee50b543bdbd77b7edb8a547c2
Diffstat (limited to 'src/backends/reference/workloads/Decoders.hpp')
-rw-r--r--src/backends/reference/workloads/Decoders.hpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/backends/reference/workloads/Decoders.hpp b/src/backends/reference/workloads/Decoders.hpp
index 328a5eb0f7..dd2b28a50f 100644
--- a/src/backends/reference/workloads/Decoders.hpp
+++ b/src/backends/reference/workloads/Decoders.hpp
@@ -7,6 +7,7 @@
#include "BaseIterator.hpp"
#include "FloatingPointConverter.hpp"
+#include "TensorUtils.hpp"
#include <boost/assert.hpp>
@@ -21,6 +22,14 @@ inline std::unique_ptr<Decoder<float>> MakeDecoder(const TensorInfo& info, const
{
switch(info.GetDataType())
{
+ case armnn::DataType::QuantizedSymm8PerAxis:
+ {
+ std::pair<unsigned int, std::vector<float>> params = armnnUtils::GetPerAxisParams(info);
+ return std::make_unique<QSymm8PerAxisDecoder>(
+ static_cast<const int8_t*>(data),
+ params.second,
+ params.first);
+ }
case DataType::QuantisedAsymm8:
{
return std::make_unique<QASymm8Decoder>(
@@ -55,7 +64,7 @@ inline std::unique_ptr<Decoder<float>> MakeDecoder(const TensorInfo& info, const
}
default:
{
- BOOST_ASSERT_MSG(false, "Not supported Data Type!");
+ BOOST_ASSERT_MSG(false, "Unsupported Data Type!");
break;
}
}