COMPMID-676: Rework TensorInfo building

Change-Id: Ic98f64ffe30739437a1fe31ef98d83ee900741e3
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95512
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
diff --git a/arm_compute/core/ITensorInfo.h b/arm_compute/core/ITensorInfo.h
index 0935152..5e8d4e8 100644
--- a/arm_compute/core/ITensorInfo.h
+++ b/arm_compute/core/ITensorInfo.h
@@ -29,13 +29,14 @@
 #include "arm_compute/core/TensorShape.h"
 #include "arm_compute/core/Types.h"
 #include "arm_compute/core/Utils.h"
+#include "arm_compute/core/utils/misc/ICloneable.h"
 
 #include <cstddef>
 
 namespace arm_compute
 {
 /** Store the tensor's metadata */
-class ITensorInfo
+class ITensorInfo : public misc::ICloneable<ITensorInfo>
 {
 public:
     /** Default virtual destructor */
@@ -45,15 +46,19 @@
      * @warning This resets the format to UNKNOWN.
      *
      * @param[in] data_type The new data type.
+     *
+     * @return Reference to this ITensorInfo object
      */
-    virtual void set_data_type(DataType data_type) = 0;
+    virtual ITensorInfo &set_data_type(DataType data_type) = 0;
     /** Set the number of channels to the specified value.
      *
      * @warning This resets the format to UNKNOWN.
      *
      * @param[in] num_channels New number of channels.
+     *
+     * @return Reference to this ITensorInfo object
      */
-    virtual void set_num_channels(int num_channels) = 0;
+    virtual ITensorInfo &set_num_channels(int num_channels) = 0;
     /** Set the format of an already initialized tensor.
      *
      * @note If the data type has already been configured (i.e. not UNKNOWN) it
@@ -61,23 +66,36 @@
      * be based on the format.
      *
      * @param[in] format Single-plane format of the tensor.
+     *
+     * @return Reference to this ITensorInfo object
      */
-    virtual void set_format(Format format) = 0;
+    virtual ITensorInfo &set_format(Format format) = 0;
     /** Set the shape of an already initialized tensor.
      *
      * @warning Changing the shape requires to recompute the strides and is
      * therefore only possible if the tensor hasn't been allocated yet.
      *
      * @param[in] shape New tensor shape.
+     *
+     * @return Reference to this ITensorInfo object
      */
-    virtual void set_tensor_shape(TensorShape shape) = 0;
+    virtual ITensorInfo &set_tensor_shape(TensorShape shape) = 0;
     /** Set the fixed point position to the specified value
      *
      * @warning The fixed point position must be set once the data type has been configured
      *
      * @param[in] fixed_point_position The new fixed point position
+     *
+     * @return Reference to this ITensorInfo object
      */
-    virtual void set_fixed_point_position(int fixed_point_position) = 0;
+    virtual ITensorInfo &set_fixed_point_position(int fixed_point_position) = 0;
+    /** Set the quantization settings (scale and offset) of the tensor.
+    *
+    * @param[in] quantization_info QuantizationInfo containing the scale and offset
+    *
+    * @return Reference to this ITensorInfo object
+    */
+    virtual ITensorInfo &set_quantization_info(QuantizationInfo quantization_info) = 0;
     /** Update the offset to the first element and the strides to automatically computed values.
      *
      * @note The padding used by this method is really conservative so that the tensor can be used for most functions.
@@ -196,12 +214,6 @@
     * @return A QuantizationInfo containing the scale and offset.
     */
     virtual QuantizationInfo quantization_info() const = 0;
-
-    /** Set the quantization settings (scale and offset) of the tensor.
-    *
-    * @param[in] quantization_info QuantizationInfo containing the scale and offset.
-    */
-    virtual void set_quantization_info(QuantizationInfo quantization_info) = 0;
 };
 }
 #endif /*__ARM_COMPUTE_TENSORINFO_H__ */