aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/SubTensorInfo.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/SubTensorInfo.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/SubTensorInfo.h')
-rw-r--r--arm_compute/core/SubTensorInfo.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/arm_compute/core/SubTensorInfo.h b/arm_compute/core/SubTensorInfo.h
index 3a88ebae5a..5fec11a2e8 100644
--- a/arm_compute/core/SubTensorInfo.h
+++ b/arm_compute/core/SubTensorInfo.h
@@ -34,6 +34,7 @@
#include "arm_compute/core/Validate.h"
#include <cstddef>
+#include <memory>
namespace arm_compute
{
@@ -50,7 +51,7 @@ public:
* X and Y dimensions must match the parent's ones.
* @param[in] coords Coordinates of starting element inside parent tensor.
*/
- SubTensorInfo(ITensorInfo *parent, const TensorShape &tensor_shape, const Coordinates &coords);
+ SubTensorInfo(ITensorInfo *parent, TensorShape tensor_shape, Coordinates coords);
/** Default destructor */
~SubTensorInfo() = default;
/** Allow instances of this class to be copy constructed */
@@ -71,27 +72,38 @@ public:
}
// Inherited methods overridden:
- void set_data_type(DataType data_type) override
+ std::unique_ptr<ITensorInfo> clone() const override;
+ ITensorInfo &set_data_type(DataType data_type) override
{
ARM_COMPUTE_ERROR_ON(_parent == nullptr);
_parent->set_data_type(data_type);
+ return *this;
};
- void set_num_channels(int num_channels) override
+ ITensorInfo &set_num_channels(int num_channels) override
{
ARM_COMPUTE_ERROR_ON(_parent == nullptr);
_parent->set_num_channels(num_channels);
+ return *this;
};
- void set_format(Format format) override
+ ITensorInfo &set_format(Format format) override
{
ARM_COMPUTE_ERROR_ON(_parent == nullptr);
_parent->set_format(format);
+ return *this;
};
- void set_fixed_point_position(int fixed_point_position) override
+ ITensorInfo &set_fixed_point_position(int fixed_point_position) override
{
ARM_COMPUTE_ERROR_ON(_parent == nullptr);
_parent->set_fixed_point_position(fixed_point_position);
+ return *this;
};
- void set_tensor_shape(TensorShape shape) override;
+ ITensorInfo &set_tensor_shape(TensorShape shape) override;
+ ITensorInfo &set_quantization_info(QuantizationInfo quantization_info) override
+ {
+ ARM_COMPUTE_ERROR_ON(_parent == nullptr);
+ _parent->set_quantization_info(quantization_info);
+ return *this;
+ }
bool auto_padding() override
{
ARM_COMPUTE_ERROR_ON(_parent == nullptr);
@@ -191,11 +203,6 @@ public:
ARM_COMPUTE_ERROR_ON(_parent == nullptr);
return _parent->quantization_info();
}
- void set_quantization_info(QuantizationInfo quantization_info) override
- {
- ARM_COMPUTE_ERROR_ON(_parent == nullptr);
- _parent->set_quantization_info(quantization_info);
- }
private:
ITensorInfo *_parent;