aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/reference
diff options
context:
space:
mode:
authorManuel Bottini <manuel.bottini@arm.com>2019-07-17 16:11:53 +0100
committerManuel Bottini <manuel.bottini@arm.com>2019-07-22 14:06:55 +0000
commit10c53f1ef317095ddcd9143bf759cc68ecb0e721 (patch)
tree644954b909692f1d6b4e20194e81708503a62c2b /tests/validation/reference
parentd176d54b94c5337c97bd87671ce390804da8c10b (diff)
downloadComputeLibrary-10c53f1ef317095ddcd9143bf759cc68ecb0e721.tar.gz
COMPMID-2307: QUANTIZED_16BIT_LSTM operator for CL
Change-Id: I1b52df359f1a368d585fac43a08496544dd2f86f Signed-off-by: Manuel Bottini <manuel.bottini@arm.com> Reviewed-on: https://review.mlplatform.org/c/1568 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Giuseppe Rossini <giuseppe.rossini@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/reference')
-rw-r--r--tests/validation/reference/DequantizationLayer.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/validation/reference/DequantizationLayer.cpp b/tests/validation/reference/DequantizationLayer.cpp
index d07371c883..cceee0421c 100644
--- a/tests/validation/reference/DequantizationLayer.cpp
+++ b/tests/validation/reference/DequantizationLayer.cpp
@@ -45,6 +45,11 @@ TOut dequantize(uint8_t val, const UniformQuantizationInfo qinfo)
{
return static_cast<TOut>(dequantize_qasymm8(val, qinfo));
}
+template <typename TOut>
+TOut dequantize(int16_t val, const UniformQuantizationInfo qinfo)
+{
+ return static_cast<TOut>(dequantize_qsymm16(val, qinfo));
+}
template <typename TOut, typename TIn>
SimpleTensor<TOut> dequantization_layer_nchw(const SimpleTensor<TIn> &src)
@@ -72,7 +77,7 @@ SimpleTensor<TOut> dequantization_layer_nchw(const SimpleTensor<TIn> &src)
// Dequantize slice
for(int s = 0; s < WH; ++s)
{
- dst[idx + s] = dequantize<TOut>(src[idx + s], channel_qinfo);
+ dst[idx + s] = dequantize<TOut>(static_cast<TIn>(src[idx + s]), channel_qinfo);
}
}
}
@@ -84,7 +89,7 @@ SimpleTensor<TOut> dequantization_layer_nchw(const SimpleTensor<TIn> &src)
for(int i = 0; i < src.num_elements(); ++i)
{
- dst[i] = static_cast<TOut>(dequantize<TOut>(src[i], quantization_info));
+ dst[i] = static_cast<TOut>(dequantize<TOut>(static_cast<TIn>(src[i]), quantization_info));
}
}
@@ -109,6 +114,8 @@ template SimpleTensor<half> dequantization_layer(const SimpleTensor<uint8_t> &sr
template SimpleTensor<float> dequantization_layer(const SimpleTensor<uint8_t> &src);
template SimpleTensor<half> dequantization_layer(const SimpleTensor<int8_t> &src);
template SimpleTensor<float> dequantization_layer(const SimpleTensor<int8_t> &src);
+template SimpleTensor<half> dequantization_layer(const SimpleTensor<int16_t> &src);
+template SimpleTensor<float> dequantization_layer(const SimpleTensor<int16_t> &src);
} // namespace reference
} // namespace validation
} // namespace test