aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/ITensorInfo.h
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-11-10 18:14:06 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commit283c1790da45ab562ecfb2aa7741297191886d85 (patch)
tree45956bb79167e17aa634fd5f4d05c68ba059274c /arm_compute/core/ITensorInfo.h
parent624b77859dc9d0618056dad66833b9c37033337b (diff)
downloadComputeLibrary-283c1790da45ab562ecfb2aa7741297191886d85.tar.gz
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>
Diffstat (limited to 'arm_compute/core/ITensorInfo.h')
-rw-r--r--arm_compute/core/ITensorInfo.h36
1 files changed, 24 insertions, 12 deletions
diff --git a/arm_compute/core/ITensorInfo.h b/arm_compute/core/ITensorInfo.h
index 09351522dd..5e8d4e8136 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 @@ public:
* @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 @@ public:
* 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 @@ public:
* @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__ */