aboutsummaryrefslogtreecommitdiff
path: root/src/core/SubTensorInfo.cpp
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 /src/core/SubTensorInfo.cpp
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 'src/core/SubTensorInfo.cpp')
-rw-r--r--src/core/SubTensorInfo.cpp11
1 files changed, 9 insertions, 2 deletions
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<ITensorInfo> SubTensorInfo::clone() const
+{
+ return support::cpp14::make_unique<SubTensorInfo>(*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)