From 35767bc09f21050a9767a91b086b327afc928a81 Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Wed, 5 Dec 2018 17:36:30 +0000 Subject: COMPMID-1697: NEPermute extended support for more cases. Regardless the input data layout NEPermute function has been added support for the all the permutations of 4d tensors Added corresponding validation tests. Change-Id: I0f8f20c2c3716e908a18a59783be53efab80ef5b Reviewed-on: https://review.mlplatform.org/367 Reviewed-by: Giuseppe Rossini Tested-by: Arm Jenkins --- tests/validation/fixtures/PermuteFixture.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/validation/fixtures/PermuteFixture.h') diff --git a/tests/validation/fixtures/PermuteFixture.h b/tests/validation/fixtures/PermuteFixture.h index 3aae384706..92d01a5654 100644 --- a/tests/validation/fixtures/PermuteFixture.h +++ b/tests/validation/fixtures/PermuteFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -46,10 +46,10 @@ class PermuteValidationFixture : public framework::Fixture { public: template - void setup(TensorShape shape, PermutationVector perm, DataType data_type) + void setup(TensorShape input_shape, DataLayout input_layout, PermutationVector perm, DataType data_type) { - _target = compute_target(shape, data_type, perm); - _reference = compute_reference(shape, data_type, perm); + _target = compute_target(input_shape, input_layout, data_type, perm); + _reference = compute_reference(input_shape, data_type, perm); } protected: @@ -59,14 +59,14 @@ protected: library->fill_tensor_uniform(tensor, 0); } - TensorType compute_target(const TensorShape &shape, DataType data_type, PermutationVector perm) + TensorType compute_target(const TensorShape &input_shape, DataLayout input_layout, DataType data_type, PermutationVector perm) { // Permute shapes - TensorShape output_shape = shape; + TensorShape output_shape = input_shape; permute(output_shape, perm); // Create tensors - TensorType src = create_tensor(shape, data_type); + TensorType src = create_tensor(input_shape, data_type); TensorType dst = create_tensor(output_shape, data_type); // Create and configure function @@ -92,10 +92,10 @@ protected: return dst; } - SimpleTensor compute_reference(const TensorShape &shape, DataType data_type, PermutationVector perm) + SimpleTensor compute_reference(const TensorShape &input_shape, DataType data_type, PermutationVector perm) { // Create reference - SimpleTensor src{ shape, data_type }; + SimpleTensor src{ input_shape, data_type }; // Fill reference fill(src); -- cgit v1.2.1