FIX: seg fault when printing TensorInfo's quantization info per channel

Resolves: COMPMID-4818
Signed-off-by: Ramy Elgammal <ramy.elgammal@arm.com>
Change-Id: I2ac4b84181a1b432aa34e22b9ffa9a1c882a32aa
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6319
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Pablo Marquez Tello <pablo.tello@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
diff --git a/utils/TypePrinter.h b/utils/TypePrinter.h
index c364102..23df2dc 100644
--- a/utils/TypePrinter.h
+++ b/utils/TypePrinter.h
@@ -67,6 +67,45 @@
     }
 }
 
+/** Formatted output of a vector of objects.
+ *
+ * @param[out] os   Output stream
+ * @param[in]  args Vector of objects to print
+ *
+ * @return Modified output stream.
+ */
+template <typename T>
+inline ::std::ostream &operator<<(::std::ostream &os, const std::vector<T> &args)
+{
+    const size_t max_print_size = 5U;
+
+    os << "[";
+    bool   first = true;
+    size_t i;
+    for(i = 0; i < args.size(); ++i)
+    {
+        if(i == max_print_size)
+        {
+            break;
+        }
+        if(first)
+        {
+            first = false;
+        }
+        else
+        {
+            os << ", ";
+        }
+        os << args[i];
+    }
+    if(i < args.size())
+    {
+        os << ", ...";
+    }
+    os << "]";
+    return os;
+}
+
 /** Formatted output of the Dimensions type.
  *
  * @param[out] os         Output stream.
@@ -1037,25 +1076,16 @@
 
     if(is_data_type_quantized(data_type))
     {
-        const QuantizationInfo qinfo = info->quantization_info();
-        os << "QuantizationInfo=";
-        if(is_data_type_quantized_per_channel(data_type))
-        {
-            os << "[";
-            const auto scales  = qinfo.scale();
-            const auto offsets = qinfo.offset();
-            os << "(" << scales[0] << ", " << offsets[0] << ")";
-            for(size_t i = 1; i < scales.size(); ++i)
-            {
-                os << ",(" << scales[i] << ", " << offsets[i] << ")";
-            }
-            os << "]";
-        }
-        else
-        {
-            os << "(" << qinfo.uniform().scale << ", "
-               << qinfo.uniform().offset << ")";
-        }
+        const QuantizationInfo qinfo   = info->quantization_info();
+        const auto             scales  = qinfo.scale();
+        const auto             offsets = qinfo.offset();
+
+        os << "QuantizationInfo={"
+           << "scales.size=" << scales.size()
+           << ", scale(s)=" << scales << ", ";
+
+        os << "offsets.size=" << offsets.size()
+           << ", offset(s)=" << offsets << "}";
     }
     return os;
 }
@@ -1773,9 +1803,18 @@
         case ElementWiseUnary::LOG:
             os << "LOG";
             break;
+        case ElementWiseUnary::SIN:
+            os << "SIN";
+            break;
+        case ElementWiseUnary::ABS:
+            os << "ABS";
+            break;
         case ElementWiseUnary::ROUND:
             os << "ROUND";
             break;
+        case ElementWiseUnary::LOGICAL_NOT:
+            os << "LOGICAL_NOT";
+            break;
         default:
             ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
     }
@@ -2179,34 +2218,6 @@
     return str.str();
 }
 
-/** Formatted output of a vector of objects.
- *
- * @param[out] os   Output stream
- * @param[in]  args Vector of objects to print
- *
- * @return Modified output stream.
- */
-template <typename T>
-inline ::std::ostream &operator<<(::std::ostream &os, const std::vector<T> &args)
-{
-    os << "[";
-    bool first = true;
-    for(auto &arg : args)
-    {
-        if(first)
-        {
-            first = false;
-        }
-        else
-        {
-            os << ", ";
-        }
-        os << arg;
-    }
-    os << "]";
-    return os;
-}
-
 /** Formatted output of @ref PriorBoxLayerInfo.
  *
  * @param[out] os   Output stream.