aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/fixtures/BatchNormalizationLayerFixture.h
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2018-04-30 17:29:41 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:51:17 +0000
commit563494c2f447e201e88e6d7133a41e12971777eb (patch)
tree716ae5e4978ce378ad14f53591087a7a42f6fe58 /tests/validation/fixtures/BatchNormalizationLayerFixture.h
parentb7f5d172ccdb1d884388dd6e0e54f74241afca67 (diff)
downloadComputeLibrary-563494c2f447e201e88e6d7133a41e12971777eb.tar.gz
COMPMID-1084 Rework the way validation is performed for NHWC data layout
Change-Id: I00b95f560548da76718298b642c8166f92421097 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/129520 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Michele DiGiorgio <michele.digiorgio@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/validation/fixtures/BatchNormalizationLayerFixture.h')
-rw-r--r--tests/validation/fixtures/BatchNormalizationLayerFixture.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/validation/fixtures/BatchNormalizationLayerFixture.h b/tests/validation/fixtures/BatchNormalizationLayerFixture.h
index 7e072e7023..b7e32a6f37 100644
--- a/tests/validation/fixtures/BatchNormalizationLayerFixture.h
+++ b/tests/validation/fixtures/BatchNormalizationLayerFixture.h
@@ -52,13 +52,8 @@ public:
_use_beta = use_beta;
_use_gamma = use_gamma;
- if(data_layout == DataLayout::NHWC)
- {
- permute(shape0, PermutationVector(2U, 0U, 1U));
- }
-
_target = compute_target(shape0, shape1, epsilon, act_info, dt, data_layout, fractional_bits);
- _reference = compute_reference(shape0, shape1, epsilon, act_info, dt, data_layout, fractional_bits);
+ _reference = compute_reference(shape0, shape1, epsilon, act_info, dt, fractional_bits);
}
protected:
@@ -125,8 +120,13 @@ protected:
}
}
- TensorType compute_target(const TensorShape &shape0, const TensorShape &shape1, float epsilon, ActivationLayerInfo act_info, DataType dt, DataLayout data_layout, int fixed_point_position)
+ TensorType compute_target(TensorShape shape0, const TensorShape &shape1, float epsilon, ActivationLayerInfo act_info, DataType dt, DataLayout data_layout, int fixed_point_position)
{
+ if(data_layout == DataLayout::NHWC)
+ {
+ permute(shape0, PermutationVector(2U, 0U, 1U));
+ }
+
// Create tensors
TensorType src = create_tensor<TensorType>(shape0, dt, 1, fixed_point_position, QuantizationInfo(), data_layout);
TensorType dst = create_tensor<TensorType>(shape0, dt, 1, fixed_point_position, QuantizationInfo(), data_layout);
@@ -172,10 +172,10 @@ protected:
return dst;
}
- SimpleTensor<T> compute_reference(const TensorShape &shape0, const TensorShape &shape1, float epsilon, ActivationLayerInfo act_info, DataType dt, DataLayout data_layout, int fixed_point_position)
+ SimpleTensor<T> compute_reference(const TensorShape &shape0, const TensorShape &shape1, float epsilon, ActivationLayerInfo act_info, DataType dt, int fixed_point_position)
{
// Create reference
- SimpleTensor<T> ref_src{ shape0, dt, 1, fixed_point_position, QuantizationInfo(), data_layout };
+ SimpleTensor<T> ref_src{ shape0, dt, 1, fixed_point_position };
SimpleTensor<T> ref_mean{ shape1, dt, 1, fixed_point_position };
SimpleTensor<T> ref_var{ shape1, dt, 1, fixed_point_position };
SimpleTensor<T> ref_beta{ shape1, dt, 1, fixed_point_position };