IVGCVSW-5353 - Fix skipped concat VTS tests

 * Added 3D permutation vector to prevent mismatch between mappings
   and numDimensions in dynamic concats

Signed-off-by: David Monahan <david.monahan@arm.com>
Change-Id: Ia580deaa8a4f6245c7e4d319d5d0ed837c7dc02a
diff --git a/ConversionUtils.hpp b/ConversionUtils.hpp
index 5837d3d..f139383 100644
--- a/ConversionUtils.hpp
+++ b/ConversionUtils.hpp
@@ -489,6 +489,7 @@
 
 // 4D Tensor Permutations
 const armnn::PermutationVector IdentityPermutation4D({ 0U, 1U, 2U, 3U });
+const armnn::PermutationVector IdentityPermutation3D({ 0U, 1U, 2U });
 const armnn::PermutationVector SwapDim1And2({ 0U, 2U, 1U, 3U });
 
 // 3D Permutation Vectors
@@ -588,7 +589,8 @@
                           std::vector<armnn::TensorShape>& inputShapes,
                           const armnn::PermutationVector& mapping)
 {
-    if (!mapping.IsEqual(IdentityPermutation4D))
+    // If we have a IdentityPermutation4D or IdentityPermutation3D then we are not permuting
+    if (!mapping.IsEqual(IdentityPermutation4D) && !mapping.IsEqual(IdentityPermutation3D))
     {
         armnn::TensorInfo outputTransposeInfo;
         size_t nInputs = inputs.size();
@@ -641,6 +643,12 @@
         permutationPair = std::make_pair(RotateTensorLeft, RotateTensorRight);
         needPermute = true;
     }
+    // If the tensor is 3-D and the concat dimension is 2 then we don't need to permute but we do need to change the
+    // permutation identity to only have 3 dimensions
+    else if (numberOfDimensions == 3 && concatDimension == 2)
+    {
+        permutationPair = std::make_pair(IdentityPermutation3D, IdentityPermutation3D);
+    }
     return needPermute;
 }
 
@@ -2134,7 +2142,6 @@
     // Permutation is required when the concat dimension is 2 for a 4D tensor or 1 for a 3D tensor.
     std::pair<armnn::PermutationVector, armnn::PermutationVector> permutationPair =
         std::make_pair(IdentityPermutation4D, IdentityPermutation4D);
-
     bool needPermute = CreateConcatPermutationParameters(inputShapes[0].GetNumDimensions(),
                                                          concatDim,
                                                          permutationPair);
@@ -2232,7 +2239,6 @@
                                    inputTransposeInfo,
                                    outputTransposeInfo,
                                    transposeDesc);
-
         if (!isSupported)
         {
             return false;
@@ -2255,7 +2261,7 @@
         if (isDynamicTensor)
         {
             // Infer the output shapes of concat if outputs are type 1 dynamic
-            layer->GetOutputSlot(0).IsTensorInfoSet();
+            ARMNN_ASSERT(layer->GetOutputSlot(0).IsTensorInfoSet());
             if (!ValidateConcatOutputShape(inputShapes,
                                            layer->GetOutputSlot(0).GetTensorInfo().GetShape(),
                                            concatDim))
@@ -2266,7 +2272,6 @@
         }
 
         armnn::TensorInfo afterConcatInfo = layer->GetOutputSlot(0).GetTensorInfo();
-
         // Undo the reshape knowing the amount of dimensions added
         if (tensorDimensionsAdded == 1)
         {
@@ -2306,7 +2311,6 @@
         {
             return false;
         }
-
         layer = &AddReshapeLayer(*data.m_Network, layer->GetOutputSlot(0), afterConcatInfo);
         return SetupAndTrackLayerOutputSlot<HalPolicy>(operation,
                                                        0,