aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/fixtures/QuantizationLayerFixture.h
diff options
context:
space:
mode:
authorMichele Di Giorgio <michele.digiorgio@arm.com>2019-09-10 10:42:27 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-09-16 14:43:54 +0000
commitd87a7b297a5bfc2bad3ba78ea97754d7894e82ef (patch)
treec527ede747d386fe8dd1b39a877ea4e9a19a5fd3 /tests/validation/fixtures/QuantizationLayerFixture.h
parente874ef9b845424dceeac4211ca9dfec24949f03c (diff)
downloadComputeLibrary-d87a7b297a5bfc2bad3ba78ea97754d7894e82ef.tar.gz
COMPMID-2650: Add support for QASYMM16 in CLQuantizationLayer
Change-Id: I51dda621975f522a65d770304bed0ff0f30d1235 Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-on: https://review.mlplatform.org/c/1902 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests/validation/fixtures/QuantizationLayerFixture.h')
-rw-r--r--tests/validation/fixtures/QuantizationLayerFixture.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/validation/fixtures/QuantizationLayerFixture.h b/tests/validation/fixtures/QuantizationLayerFixture.h
index 84d4d7a7b3..4ffc659027 100644
--- a/tests/validation/fixtures/QuantizationLayerFixture.h
+++ b/tests/validation/fixtures/QuantizationLayerFixture.h
@@ -42,15 +42,15 @@ namespace test
{
namespace validation
{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
+template <typename TensorType, typename AccessorType, typename FunctionType, typename Tin, typename Tout>
class QuantizationValidationFixture : public framework::Fixture
{
public:
template <typename...>
- void setup(TensorShape shape, DataType data_type, QuantizationInfo quant_info)
+ void setup(TensorShape shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo)
{
- _target = compute_target(shape, data_type, quant_info);
- _reference = compute_reference(shape, data_type, quant_info);
+ _target = compute_target(shape, data_type_in, data_type_out, qinfo);
+ _reference = compute_reference(shape, data_type_in, data_type_out, qinfo);
}
protected:
@@ -60,11 +60,11 @@ protected:
library->fill_tensor_uniform(tensor, 0);
}
- TensorType compute_target(const TensorShape &shape, DataType data_type, QuantizationInfo quant_info)
+ TensorType compute_target(const TensorShape &shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo)
{
// Create tensors
- TensorType src = create_tensor<TensorType>(shape, data_type);
- TensorType dst = create_tensor<TensorType>(shape, DataType::QASYMM8, 1, quant_info);
+ TensorType src = create_tensor<TensorType>(shape, data_type_in);
+ TensorType dst = create_tensor<TensorType>(shape, data_type_out, 1, qinfo);
// Create and configure function
FunctionType quantization_layer;
@@ -89,19 +89,19 @@ protected:
return dst;
}
- SimpleTensor<uint8_t> compute_reference(const TensorShape &shape, DataType data_type, QuantizationInfo quant_info)
+ SimpleTensor<Tout> compute_reference(const TensorShape &shape, DataType data_type_in, DataType data_type_out, QuantizationInfo qinfo)
{
// Create reference
- SimpleTensor<T> src{ shape, data_type };
+ SimpleTensor<Tin> src{ shape, data_type_in };
// Fill reference
fill(src);
- return reference::quantization_layer<T>(src, quant_info);
+ return reference::quantization_layer<Tin, Tout>(src, data_type_out, qinfo);
}
- TensorType _target{};
- SimpleTensor<uint8_t> _reference{};
+ TensorType _target{};
+ SimpleTensor<Tout> _reference{};
};
} // namespace validation