COMPMID-1710: Fix DepthConcatenate reference with different quantization

Change-Id: If154fcc383039bf7a7ad46d4110067c45b922707
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/737
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
diff --git a/tests/validation/reference/DepthConcatenateLayer.cpp b/tests/validation/reference/DepthConcatenateLayer.cpp
index f0dab3b..139675d 100644
--- a/tests/validation/reference/DepthConcatenateLayer.cpp
+++ b/tests/validation/reference/DepthConcatenateLayer.cpp
@@ -45,13 +45,17 @@
     }
 
     // Compute reference
-    int       depth_offset = 0;
-    const int width_out    = dst.shape().x();
-    const int height_out   = dst.shape().y();
-    const int depth_out    = dst.shape().z();
-    const int out_stride_z = width_out * height_out;
-    const int batches      = dst.shape().total_size_upper(3);
-    if(srcs[0].data_type() == DataType::QASYMM8 && srcs[0].quantization_info() != dst.quantization_info())
+    int       depth_offset                = 0;
+    const int width_out                   = dst.shape().x();
+    const int height_out                  = dst.shape().y();
+    const int depth_out                   = dst.shape().z();
+    const int out_stride_z                = width_out * height_out;
+    const int batches                     = dst.shape().total_size_upper(3);
+    auto have_different_quantization_info = [&](const SimpleTensor<T> &tensor)
+    {
+        return tensor.quantization_info() != dst.quantization_info();
+    };
+    if(srcs[0].data_type() == DataType::QASYMM8 && std::any_of(srcs.cbegin(), srcs.cend(), have_different_quantization_info))
     {
         for(int b = 0; b < batches; ++b)
         {