From 2f60221e60b69852918581b4eb450a0f81455a46 Mon Sep 17 00:00:00 2001 From: Manuel Bottini Date: Thu, 30 Jan 2020 17:30:32 +0000 Subject: COMPMID-3046: Add CLRequantizationLayerKernel Change-Id: I034f5aa023642f2323372495ddd14fc62b4c12e0 Signed-off-by: Manuel Bottini Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2681 Comments-Addressed: Arm Jenkins Reviewed-by: Giorgio Arena Tested-by: Arm Jenkins --- .../validation/fixtures/QuantizationLayerFixture.h | 29 +++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'tests/validation/fixtures/QuantizationLayerFixture.h') 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 -class QuantizationValidationFixture : public framework::Fixture +class QuantizationValidationGenericFixture : public framework::Fixture { public: template - 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(shape, data_type_in); + TensorType src = create_tensor(shape, data_type_in, 1, qinfo_in); TensorType dst = create_tensor(shape, data_type_out, 1, qinfo); // Create and configure function @@ -89,10 +89,10 @@ protected: return dst; } - SimpleTensor compute_reference(const TensorShape &shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo) + SimpleTensor compute_reference(const TensorShape &shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo, QuantizationInfo qinfo_in) { // Create reference - SimpleTensor src{ shape, data_type_in }; + SimpleTensor src{ shape, data_type_in, 1, qinfo_in }; // Fill reference fill(src); @@ -104,6 +104,17 @@ protected: SimpleTensor _reference{}; }; +template +class QuantizationValidationFixture : public QuantizationValidationGenericFixture +{ +public: + template + void setup(TensorShape shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo) + { + QuantizationValidationGenericFixture::setup(shape, data_type_in, data_type_out, qinfo, QuantizationInfo()); + } +}; + } // namespace validation } // namespace test } // namespace arm_compute -- cgit v1.2.1