From 7282d562d459066dff3e27fd5299f71e0809990d Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Thu, 14 Jun 2018 15:35:49 +0100 Subject: COMPMID-1287: Extending NEWinogradLayer test suite Added NHWC to the dataset to the validation tests Fixed a problem in the output transform which made the Activation to fail because way/ordering the output transform wrote the data to the output tensor. Change-Id: I9609f86605dbfef70b47a0fb043287bf0e5d675b Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/136015 Tested-by: Jenkins Reviewed-by: Georgios Pinitas --- .../fixtures/WinogradConvolutionLayerFixture.h | 26 ++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'tests/validation/fixtures/WinogradConvolutionLayerFixture.h') diff --git a/tests/validation/fixtures/WinogradConvolutionLayerFixture.h b/tests/validation/fixtures/WinogradConvolutionLayerFixture.h index 07795c2361..aca24f13ae 100644 --- a/tests/validation/fixtures/WinogradConvolutionLayerFixture.h +++ b/tests/validation/fixtures/WinogradConvolutionLayerFixture.h @@ -160,11 +160,12 @@ class WinogradConvolutionLayerFastMathValidationFixture : public framework::Fixt { public: template - void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info, Size2D dilation, DataType data_type, ActivationLayerInfo act_info) + void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info, Size2D dilation, + DataType data_type, ActivationLayerInfo act_info, const DataLayout &data_layout) + { ARM_COMPUTE_UNUSED(dilation); - - _target = compute_target(input_shape, weights_shape, bias_shape, output_shape, info, data_type, act_info); + _target = compute_target(input_shape, weights_shape, bias_shape, output_shape, info, data_type, act_info, data_layout); _reference = compute_reference(input_shape, weights_shape, bias_shape, output_shape, info, data_type, act_info); } @@ -189,14 +190,21 @@ protected: } } - TensorType compute_target(const TensorShape &input_shape, const TensorShape &weights_shape, const TensorShape &bias_shape, const TensorShape &output_shape, const PadStrideInfo &info, - DataType data_type, ActivationLayerInfo act_info) + TensorType compute_target(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, const PadStrideInfo &info, + DataType data_type, ActivationLayerInfo act_info, const DataLayout data_layout) { + if(data_layout == DataLayout::NHWC) + { + permute(input_shape, PermutationVector(2U, 0U, 1U)); + permute(weights_shape, PermutationVector(2U, 0U, 1U)); + permute(output_shape, PermutationVector(2U, 0U, 1U)); + } + // Create tensors - TensorType src = create_tensor(input_shape, data_type, 1); - TensorType weights = create_tensor(weights_shape, data_type, 1); - TensorType bias = create_tensor(bias_shape, data_type, 1); - TensorType dst = create_tensor(output_shape, data_type, 1); + TensorType src = create_tensor(input_shape, data_type, 1, 0, QuantizationInfo(), data_layout); + TensorType weights = create_tensor(weights_shape, data_type, 1, 0, QuantizationInfo(), data_layout); + TensorType bias = create_tensor(bias_shape, data_type, 1, 0, QuantizationInfo(), data_layout); + TensorType dst = create_tensor(output_shape, data_type, 1, 0, QuantizationInfo(), data_layout); // Create and configure function FunctionType conv; -- cgit v1.2.1