From e2c82fee3b6d38f6e79412c78176792b817defd0 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 2 Oct 2017 18:51:47 +0100 Subject: COMPMID-550: Adds support for branches. Change-Id: I778007c9221ce3156400284c4039b90245eb2b7f Reviewed-on: http://mpd-gerrit.cambridge.arm.com/90043 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- arm_compute/core/SubTensorInfo.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'arm_compute/core/SubTensorInfo.h') diff --git a/arm_compute/core/SubTensorInfo.h b/arm_compute/core/SubTensorInfo.h index 54fb66a573..81a27026e7 100644 --- a/arm_compute/core/SubTensorInfo.h +++ b/arm_compute/core/SubTensorInfo.h @@ -61,6 +61,14 @@ public: SubTensorInfo(SubTensorInfo &&) = default; /** Allow instances of this class to be moved */ SubTensorInfo &operator=(SubTensorInfo &&) = default; + /** Returns the coordinates of the sub-tensor inside the parent tensor + * + * @return Sub-tensor coordinates + */ + Coordinates coords() const + { + return _coords; + } // Inherited methods overridden: void set_data_type(DataType data_type) override @@ -171,7 +179,11 @@ public: void set_valid_region(ValidRegion valid_region) override { ARM_COMPUTE_ERROR_ON(_parent == nullptr); - ARM_COMPUTE_ERROR_ON_INVALID_SUBTENSOR_VALID_REGION(_parent->valid_region(), valid_region); + // Check if subtensor is valid if parent is configured + if(_parent->tensor_shape().total_size() != 0) + { + ARM_COMPUTE_ERROR_ON_INVALID_SUBTENSOR_VALID_REGION(_parent->valid_region(), valid_region); + } _valid_region = std::move(valid_region); } -- cgit v1.2.1