diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2017-12-12 12:20:55 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:42:33 +0000 |
commit | 9d364848fb32ae226e46b3df81220d52fd6a94b2 (patch) | |
tree | d1ec714fb0994926a300763efe1bbc3fd80f90f6 | |
parent | c79519648b9e908c26cefc436a3c34b83f36403c (diff) | |
download | ComputeLibrary-9d364848fb32ae226e46b3df81220d52fd6a94b2.tar.gz |
COMPMID-556: Force clone() of SubTensorInfo come from a TensorInfo
Change-Id: I78d05545393ce0ed05ae4ada500a5909e8ce0a33
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/112874
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: Anthony Barbier <anthony.barbier@arm.com>
-rw-r--r-- | src/core/SubTensorInfo.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/SubTensorInfo.cpp b/src/core/SubTensorInfo.cpp index 4c558bfae9..8acd71ceb0 100644 --- a/src/core/SubTensorInfo.cpp +++ b/src/core/SubTensorInfo.cpp @@ -53,7 +53,13 @@ SubTensorInfo::SubTensorInfo(ITensorInfo *parent, TensorShape tensor_shape, Coor std::unique_ptr<ITensorInfo> SubTensorInfo::clone() const { - return support::cpp14::make_unique<SubTensorInfo>(*this); + // Clone creates a TensorInfo object from SubTensorInfo's parent which will conclude to a TensorInfo + // For now it does not make sense to copy a SubTensorInfo explicitly + ARM_COMPUTE_ERROR_ON(_parent == nullptr); + auto clone_obj = _parent->clone(); + clone_obj->set_tensor_shape(_tensor_shape); + clone_obj->set_valid_region(_valid_region); + return clone_obj; } ITensorInfo &SubTensorInfo::set_tensor_shape(TensorShape shape) |