From 283c1790da45ab562ecfb2aa7741297191886d85 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Fri, 10 Nov 2017 18:14:06 +0000 Subject: COMPMID-676: Rework TensorInfo building Change-Id: Ic98f64ffe30739437a1fe31ef98d83ee900741e3 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95512 Reviewed-by: Michalis Spyrou Tested-by: Kaizen Reviewed-by: Anthony Barbier --- src/core/SubTensorInfo.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/core/SubTensorInfo.cpp') diff --git a/src/core/SubTensorInfo.cpp b/src/core/SubTensorInfo.cpp index 878283bd8e..4c558bfae9 100644 --- a/src/core/SubTensorInfo.cpp +++ b/src/core/SubTensorInfo.cpp @@ -26,6 +26,7 @@ #include "arm_compute/core/Error.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/Validate.h" +#include "support/ToolchainSupport.h" using namespace arm_compute; @@ -34,7 +35,7 @@ SubTensorInfo::SubTensorInfo() { } -SubTensorInfo::SubTensorInfo(ITensorInfo *parent, const TensorShape &tensor_shape, const Coordinates &coords) +SubTensorInfo::SubTensorInfo(ITensorInfo *parent, TensorShape tensor_shape, Coordinates coords) : _parent(parent), _tensor_shape(tensor_shape), _coords(coords), _valid_region{ Coordinates(), _tensor_shape } { ARM_COMPUTE_ERROR_ON(parent == nullptr); @@ -50,7 +51,12 @@ SubTensorInfo::SubTensorInfo(ITensorInfo *parent, const TensorShape &tensor_shap _valid_region = ValidRegion{ coordinates, _tensor_shape }; } -void SubTensorInfo::set_tensor_shape(TensorShape shape) +std::unique_ptr SubTensorInfo::clone() const +{ + return support::cpp14::make_unique(*this); +} + +ITensorInfo &SubTensorInfo::set_tensor_shape(TensorShape shape) { ARM_COMPUTE_ERROR_ON(_parent == nullptr); // Check if subtensor is valid if parent is configured @@ -59,6 +65,7 @@ void SubTensorInfo::set_tensor_shape(TensorShape shape) ARM_COMPUTE_ERROR_ON_INVALID_SUBTENSOR(_parent->tensor_shape(), _coords, shape); } _tensor_shape = shape; + return *this; } bool SubTensorInfo::extend_padding(const PaddingSize &padding) -- cgit v1.2.1