diff options
author | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-04-11 17:16:27 +0100 |
---|---|---|
committer | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-04-19 08:40:45 +0000 |
commit | 9c7c2d2d23693877867bb3284c577b33cfbff471 (patch) | |
tree | f470a88b23498c1b5d13c5f9578caaf9d0599b74 /tests/SimpleTensor.h | |
parent | 9d0c4deb760efc2ca07e5e0b8218995201ad8a1f (diff) | |
download | ComputeLibrary-9c7c2d2d23693877867bb3284c577b33cfbff471.tar.gz |
Add quantized support for CPU MatMul
Resolves: COMPMID-5899
Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Change-Id: I89d96e292c3492ba9b1900a3e5683f9dcd11dfc6
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9440
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/SimpleTensor.h')
-rw-r--r-- | tests/SimpleTensor.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/SimpleTensor.h b/tests/SimpleTensor.h index c1bd7f87b5..9ea171d492 100644 --- a/tests/SimpleTensor.h +++ b/tests/SimpleTensor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2020, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -173,6 +173,15 @@ public: */ QuantizationInfo quantization_info() const override; + /** Set the quantization information of the tensor. + * + * This function does not have any effect on the raw quantized data of the tensor. + * It simply changes the quantization information, hence changes the dequantized values. + * + * @return A reference to the current object. + */ + SimpleTensor<T> &quantization_info(const QuantizationInfo &qinfo); + /** Constant pointer to the underlying buffer. * * @return a constant pointer to the data. @@ -335,6 +344,13 @@ QuantizationInfo SimpleTensor<T>::quantization_info() const } template <typename T> +SimpleTensor<T> &SimpleTensor<T>::quantization_info(const QuantizationInfo &qinfo) +{ + _quantization_info = qinfo; + return *this; +} + +template <typename T> size_t SimpleTensor<T>::size() const { const size_t size = std::accumulate(_shape.cbegin(), _shape.cend(), 1, std::multiplies<size_t>()); |