aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/fixtures
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2019-08-22 16:52:00 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-08-30 13:39:54 +0000
commit3f632f3f16e29ebeb7065b30008060fd4bfd09f1 (patch)
treece15e27cf559bd1828b302e1257c187fece0b477 /tests/validation/fixtures
parent351bd137e48c5276963274ac741b172483e98d21 (diff)
downloadComputeLibrary-3f632f3f16e29ebeb7065b30008060fd4bfd09f1.tar.gz
COMPMID-2418: CLDequantizationLayer support for QASYMM8_PER_CHANNEL
Add support for QASYMM8_PER_CHANNEL in CLDequantiazationLayer. Added tests for NHWC and also updated NEON code to work with NHWC data layout. Cleaned up the reference implementation. Change-Id: Ic1d51f16f7f625503fffdbbb66f6487aa588f08c Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com> Reviewed-on: https://review.mlplatform.org/c/1828 Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests/validation/fixtures')
-rw-r--r--tests/validation/fixtures/DequantizationLayerFixture.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/validation/fixtures/DequantizationLayerFixture.h b/tests/validation/fixtures/DequantizationLayerFixture.h
index 4842ee1c59..c7a818fcc7 100644
--- a/tests/validation/fixtures/DequantizationLayerFixture.h
+++ b/tests/validation/fixtures/DequantizationLayerFixture.h
@@ -32,6 +32,7 @@
#include "tests/IAccessor.h"
#include "tests/framework/Asserts.h"
#include "tests/framework/Fixture.h"
+#include "tests/validation/Helpers.h"
#include "tests/validation/reference/DequantizationLayer.h"
#include <random>
@@ -47,10 +48,10 @@ class DequantizationValidationFixture : public framework::Fixture
{
public:
template <typename...>
- void setup(TensorShape shape, DataType src_data_type, DataType dst_datatype)
+ void setup(TensorShape shape, DataType src_data_type, DataType dst_datatype, DataLayout data_layout)
{
_quantization_info = generate_quantization_info(src_data_type, shape.z());
- _target = compute_target(shape, src_data_type, dst_datatype);
+ _target = compute_target(shape, src_data_type, dst_datatype, data_layout);
_reference = compute_reference(shape, src_data_type);
}
@@ -61,11 +62,16 @@ protected:
library->fill_tensor_uniform(tensor, 0);
}
- TensorType compute_target(const TensorShape &shape, DataType src_data_type, DataType dst_datatype)
+ TensorType compute_target(TensorShape shape, DataType src_data_type, DataType dst_datatype, DataLayout data_layout)
{
+ if(data_layout == DataLayout::NHWC)
+ {
+ permute(shape, PermutationVector(2U, 0U, 1U));
+ }
+
// Create tensors
- TensorType src = create_tensor<TensorType>(shape, src_data_type, 1, _quantization_info);
- TensorType dst = create_tensor<TensorType>(shape, dst_datatype);
+ TensorType src = create_tensor<TensorType>(shape, src_data_type, 1, _quantization_info, data_layout);
+ TensorType dst = create_tensor<TensorType>(shape, dst_datatype, 1, QuantizationInfo(), data_layout);
// Create and configure function
FunctionType dequantization_layer;