diff options
author | Manuel Bottini <manuel.bottini@arm.com> | 2020-01-30 17:30:32 +0000 |
---|---|---|
committer | Manuel Bottini <manuel.bottini@arm.com> | 2020-02-07 15:59:28 +0000 |
commit | 2f60221e60b69852918581b4eb450a0f81455a46 (patch) | |
tree | 25bed812a94b1dca4ec58e22f8d6a287b003106f /tests/validation/fixtures | |
parent | 0b18d9740f04cc4e9cb6000a76b9c1dcd8327e24 (diff) | |
download | ComputeLibrary-2f60221e60b69852918581b4eb450a0f81455a46.tar.gz |
COMPMID-3046: Add CLRequantizationLayerKernel
Change-Id: I034f5aa023642f2323372495ddd14fc62b4c12e0
Signed-off-by: Manuel Bottini <manuel.bottini@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2681
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/fixtures')
-rw-r--r-- | tests/validation/fixtures/QuantizationLayerFixture.h | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/tests/validation/fixtures/QuantizationLayerFixture.h b/tests/validation/fixtures/QuantizationLayerFixture.h index 4ffc659027..085abefffc 100644 --- a/tests/validation/fixtures/QuantizationLayerFixture.h +++ b/tests/validation/fixtures/QuantizationLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 ARM Limited. + * Copyright (c) 2017-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -43,14 +43,14 @@ namespace test namespace validation { template <typename TensorType, typename AccessorType, typename FunctionType, typename Tin, typename Tout> -class QuantizationValidationFixture : public framework::Fixture +class QuantizationValidationGenericFixture : public framework::Fixture { public: template <typename...> - void setup(TensorShape shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo) + void setup(TensorShape shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo, QuantizationInfo qinfo_in) { - _target = compute_target(shape, data_type_in, data_type_out, qinfo); - _reference = compute_reference(shape, data_type_in, data_type_out, qinfo); + _target = compute_target(shape, data_type_in, data_type_out, qinfo, qinfo_in); + _reference = compute_reference(shape, data_type_in, data_type_out, qinfo, qinfo_in); } protected: @@ -60,10 +60,10 @@ protected: library->fill_tensor_uniform(tensor, 0); } - TensorType compute_target(const TensorShape &shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo) + TensorType compute_target(const TensorShape &shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo, QuantizationInfo qinfo_in) { // Create tensors - TensorType src = create_tensor<TensorType>(shape, data_type_in); + TensorType src = create_tensor<TensorType>(shape, data_type_in, 1, qinfo_in); TensorType dst = create_tensor<TensorType>(shape, data_type_out, 1, qinfo); // Create and configure function @@ -89,10 +89,10 @@ protected: return dst; } - SimpleTensor<Tout> compute_reference(const TensorShape &shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo) + SimpleTensor<Tout> compute_reference(const TensorShape &shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo, QuantizationInfo qinfo_in) { // Create reference - SimpleTensor<Tin> src{ shape, data_type_in }; + SimpleTensor<Tin> src{ shape, data_type_in, 1, qinfo_in }; // Fill reference fill(src); @@ -104,6 +104,17 @@ protected: SimpleTensor<Tout> _reference{}; }; +template <typename TensorType, typename AccessorType, typename FunctionType, typename Tin, typename Tout> +class QuantizationValidationFixture : public QuantizationValidationGenericFixture<TensorType, AccessorType, FunctionType, Tin, Tout> +{ +public: + template <typename...> + void setup(TensorShape shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo) + { + QuantizationValidationGenericFixture<TensorType, AccessorType, FunctionType, Tin, Tout>::setup(shape, data_type_in, data_type_out, qinfo, QuantizationInfo()); + } +}; + } // namespace validation } // namespace test } // namespace arm_compute |