diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2019-08-22 16:52:00 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-08-30 13:39:54 +0000 |
commit | 3f632f3f16e29ebeb7065b30008060fd4bfd09f1 (patch) | |
tree | ce15e27cf559bd1828b302e1257c187fece0b477 /tests/validation/reference | |
parent | 351bd137e48c5276963274ac741b172483e98d21 (diff) | |
download | ComputeLibrary-3f632f3f16e29ebeb7065b30008060fd4bfd09f1.tar.gz |
COMPMID-2418: CLDequantizationLayer support for QASYMM8_PER_CHANNEL
Add support for QASYMM8_PER_CHANNEL in CLDequantiazationLayer.
Added tests for NHWC and also updated NEON code to work with NHWC
data layout.
Cleaned up the reference implementation.
Change-Id: Ic1d51f16f7f625503fffdbbb66f6487aa588f08c
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1828
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests/validation/reference')
-rw-r--r-- | tests/validation/reference/DequantizationLayer.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/tests/validation/reference/DequantizationLayer.cpp b/tests/validation/reference/DequantizationLayer.cpp index 74686bdaaf..69a49a3d6d 100644 --- a/tests/validation/reference/DequantizationLayer.cpp +++ b/tests/validation/reference/DequantizationLayer.cpp @@ -50,9 +50,9 @@ TOut dequantize(int16_t val, const UniformQuantizationInfo qinfo) { return static_cast<TOut>(dequantize_qsymm16(val, qinfo)); } - +} // namespace template <typename TOut, typename TIn> -SimpleTensor<TOut> dequantization_layer_nchw(const SimpleTensor<TIn> &src) +SimpleTensor<TOut> dequantization_layer(const SimpleTensor<TIn> &src) { const DataType src_data_type = src.data_type(); const DataType dst_data_type = std::is_same<TOut, float>::value ? DataType::F32 : DataType::F16; @@ -97,20 +97,6 @@ SimpleTensor<TOut> dequantization_layer_nchw(const SimpleTensor<TIn> &src) return dst; } -} // namespace -template <typename TOut, typename TIn> -SimpleTensor<TOut> dequantization_layer(const SimpleTensor<TIn> &src) -{ - if(src.data_layout() == DataLayout::NHWC && src.data_type() == DataType::QSYMM8_PER_CHANNEL) - { - SimpleTensor<TIn> src_nchw = reference::permute<TIn>(src, PermutationVector(1U, 2U, 0U)); - return reference::permute<TOut>(dequantization_layer_nchw<TOut>(src_nchw), PermutationVector(2U, 0U, 1U)); - } - else - { - return dequantization_layer_nchw<TOut>(src); - } -} template SimpleTensor<half> dequantization_layer(const SimpleTensor<uint8_t> &src); template SimpleTensor<float> dequantization_layer(const SimpleTensor<uint8_t> &src); |