From 0cbb927ac309e332ac6e6f1ab9170f041f0138ab Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Thu, 1 Mar 2018 16:56:48 +0000 Subject: COMPMID-804: Add NHWC data format support for NEON batch normalisation Change-Id: I04892e7be3f5aa58cd95917a4f90a6b4ffcf6efc Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/122897 Reviewed-by: Giorgio Arena Tested-by: Jenkins Reviewed-by: Anthony Barbier --- tests/benchmark/fixtures/BatchNormalizationLayerFixture.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests/benchmark/fixtures') diff --git a/tests/benchmark/fixtures/BatchNormalizationLayerFixture.h b/tests/benchmark/fixtures/BatchNormalizationLayerFixture.h index c55bb2acc9..ae8f8a7af1 100644 --- a/tests/benchmark/fixtures/BatchNormalizationLayerFixture.h +++ b/tests/benchmark/fixtures/BatchNormalizationLayerFixture.h @@ -42,15 +42,19 @@ class BatchNormalizationLayerFixture : public framework::Fixture { public: template - void setup(TensorShape tensor_shape, TensorShape param_shape, float epsilon, bool use_gamma, bool use_beta, ActivationLayerInfo act_info, DataType data_type, int batches) + void setup(TensorShape tensor_shape, TensorShape param_shape, float epsilon, bool use_gamma, bool use_beta, ActivationLayerInfo act_info, DataType data_type, DataLayout data_layout, int batches) { // Set batched in source and destination shapes const unsigned int fixed_point_position = 4; tensor_shape.set(tensor_shape.num_dimensions(), batches); + if(data_layout == DataLayout::NHWC) + { + permute(tensor_shape, PermutationVector(2U, 0U, 1U)); + } // Create tensors - src = create_tensor(tensor_shape, data_type, 1, fixed_point_position); - dst = create_tensor(tensor_shape, data_type, 1, fixed_point_position); + src = create_tensor(tensor_shape, data_type, 1, fixed_point_position, QuantizationInfo(), data_layout); + dst = create_tensor(tensor_shape, data_type, 1, fixed_point_position, QuantizationInfo(), data_layout); mean = create_tensor(param_shape, data_type, 1, fixed_point_position); variance = create_tensor(param_shape, data_type, 1, fixed_point_position); beta = create_tensor(param_shape, data_type, 1, fixed_point_position); -- cgit v1.2.1