From 3db5eef2f97b57b01048353055aba9c29bbd72c4 Mon Sep 17 00:00:00 2001 From: Diego Lopez Recas Date: Thu, 22 Feb 2018 16:10:17 +0000 Subject: IVGCVSW-972 Fix CL Permute validation Change-Id: Ifd8e7ea445792a0ece1955bc2bc3454e75006dc8 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/121930 Reviewed-by: Georgios Pinitas Tested-by: Jenkins Reviewed-by: Pablo Tello --- src/core/CL/kernels/CLPermuteKernel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/CL/kernels/CLPermuteKernel.cpp') diff --git a/src/core/CL/kernels/CLPermuteKernel.cpp b/src/core/CL/kernels/CLPermuteKernel.cpp index 12c2d58ef6..da34448c02 100644 --- a/src/core/CL/kernels/CLPermuteKernel.cpp +++ b/src/core/CL/kernels/CLPermuteKernel.cpp @@ -54,10 +54,10 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, c DataType::U16, DataType::S16, DataType::QS16, DataType::U32, DataType::S32, DataType::F16, DataType::F32); - ARM_COMPUTE_RETURN_ERROR_ON_MSG((input->num_dimensions() < 3), "Invalid input size!"); - ARM_COMPUTE_RETURN_ERROR_ON_MSG(((perm.num_dimensions() == 3 && !(perm[0] == 2 && perm[1] == 0 && perm[2] == 1) && !(perm[0] == 1 && perm[1] == 2 && perm[2] == 0)) || (perm.num_dimensions() == 4 - && !(perm[0] == 3 && perm[1] == 2 && perm[2] == 0 && perm[3] == 1))), - "Only [2, 0, 1],[1, 2, 0] and [3, 2, 0, 1] permutation is supported"); + ARM_COMPUTE_RETURN_ERROR_ON_MSG((perm != PermutationVector{ 2U, 0U, 1U }) + && (perm != PermutationVector{ 1U, 2U, 0U }) + && (perm != PermutationVector{ 3U, 2U, 0U, 1U }), + "Only [2, 0, 1], [1, 2, 0] and [3, 2, 0, 1] permutation is supported"); const TensorShape output_shape = misc::shape_calculator::compute_permutation_output_shape(*input, perm); -- cgit v1.2.1