IVGCVSW-7899 Cannot handle tensors with more than 5 dimensions

 * Fixed issue where then dimensions specificity didn't match the number
   of dimensions.

Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Change-Id: I72c116377276c8b7a4cd0db7f91eb911e697d420
diff --git a/Utils.cpp b/Utils.cpp
index 13eb84d..58356ac 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -100,20 +100,19 @@
     }
     else
     {
-        bool dimensionsSpecificity[5] = { true, true, true, true, true };
-        int count = 0;
-        std::for_each(operand.dimensions.data(),
-                      operand.dimensions.data() +  operand.dimensions.size(),
-                      [&](const unsigned int val)
-                      {
-                          if (val == 0)
-                          {
-                              dimensionsSpecificity[count] = false;
-                          }
-                          count++;
-                      });
+        std::vector<unsigned char> dimensionsSpecificity(operand.dimensions.size(), true);
 
-        TensorShape tensorShape(operand.dimensions.size(), operand.dimensions.data(), dimensionsSpecificity);
+        for (unsigned int i = 0; i < static_cast<unsigned int>(operand.dimensions.size()); ++i)
+        {
+            auto dim = operand.dimensions[i];
+            if (dim == 0)
+            {
+                dimensionsSpecificity[i] = false;
+            }
+        }
+        TensorShape tensorShape(operand.dimensions.size(),
+                                operand.dimensions.data(),
+                                reinterpret_cast<const bool *>(dimensionsSpecificity.data()));
         ret = TensorInfo(tensorShape, type);
     }