From 9d364848fb32ae226e46b3df81220d52fd6a94b2 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 12 Dec 2017 12:20:55 +0000 Subject: 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 Tested-by: Anthony Barbier --- src/core/SubTensorInfo.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/core/SubTensorInfo.cpp') 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 SubTensorInfo::clone() const { - return support::cpp14::make_unique(*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) -- cgit v1.2.1