diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2018-11-20 12:31:24 +0000 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2018-11-22 11:17:19 +0000 |
commit | 9d3a831d4131f8a8b37f127f11d36848d33e8496 (patch) | |
tree | 5ba1ab6ee69da474175ab82eda7ead31298af4c6 /tests/validation/fixtures/NormalizationLayerFixture.h | |
parent | 3112e33d8d0b987e85107390a0350bd5988f5f01 (diff) | |
download | ComputeLibrary-9d3a831d4131f8a8b37f127f11d36848d33e8496.tar.gz |
COMPMID-1648: CLNormalizationLayer IN_MAP_2D support for NHWC for FP32/FP16
Change-Id: I49f1d865f5e7562f1d80db849353a89ef77e6a9e
Diffstat (limited to 'tests/validation/fixtures/NormalizationLayerFixture.h')
-rw-r--r-- | tests/validation/fixtures/NormalizationLayerFixture.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/validation/fixtures/NormalizationLayerFixture.h b/tests/validation/fixtures/NormalizationLayerFixture.h index 318b77e1a7..4d6ef7019f 100644 --- a/tests/validation/fixtures/NormalizationLayerFixture.h +++ b/tests/validation/fixtures/NormalizationLayerFixture.h @@ -47,11 +47,11 @@ class NormalizationValidationGenericFixture : public framework::Fixture { public: template <typename...> - void setup(TensorShape shape, NormType norm_type, int norm_size, float beta, bool is_scaled, DataType data_type) + void setup(TensorShape shape, NormType norm_type, int norm_size, float beta, bool is_scaled, DataType data_type, DataLayout data_layout) { NormalizationLayerInfo info(norm_type, norm_size, 5, beta, 1.f, is_scaled); - _target = compute_target(shape, info, data_type); + _target = compute_target(shape, info, data_type, data_layout); _reference = compute_reference(shape, info, data_type); } @@ -63,11 +63,16 @@ protected: library->fill(tensor, distribution, 0); } - TensorType compute_target(const TensorShape &shape, NormalizationLayerInfo info, DataType data_type) + TensorType compute_target(TensorShape shape, NormalizationLayerInfo info, DataType data_type, DataLayout data_layout) { + if(data_layout == DataLayout::NHWC) + { + permute(shape, PermutationVector(2U, 0U, 1U)); + } + // Create tensors - TensorType src = create_tensor<TensorType>(shape, data_type, 1); - TensorType dst = create_tensor<TensorType>(shape, data_type, 1); + TensorType src = create_tensor<TensorType>(shape, data_type, 1, QuantizationInfo(), data_layout); + TensorType dst = create_tensor<TensorType>(shape, data_type, 1, QuantizationInfo(), data_layout); // Create and configure function FunctionType norm_layer; @@ -112,9 +117,9 @@ class NormalizationValidationFixture : public NormalizationValidationGenericFixt { public: template <typename...> - void setup(TensorShape shape, NormType norm_type, int norm_size, float beta, bool is_scaled, DataType data_type) + void setup(TensorShape shape, NormType norm_type, int norm_size, float beta, bool is_scaled, DataType data_type, DataLayout data_layout) { - NormalizationValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, norm_type, norm_size, beta, is_scaled, data_type); + NormalizationValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, norm_type, norm_size, beta, is_scaled, data_type, data_layout); } }; } // namespace validation |