aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/TensorShape.h
diff options
context:
space:
mode:
authorMoritz Pflanzer <moritz.pflanzer@arm.com>2017-07-05 16:34:28 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:15:39 +0100
commit0745a980c6a5e2d294bcd09f3c704e6cf4fe316d (patch)
tree9e4140ee657c23ca9497461019772aba4f9ba4dd /arm_compute/core/TensorShape.h
parentb158fba3d2724abab70706f04069da6fc9146429 (diff)
downloadComputeLibrary-0745a980c6a5e2d294bcd09f3c704e6cf4fe316d.tar.gz
COMPMID-417: Fix assert in GEMMTranspose
The assert was checking the wrong thing. Only if the window over the input is smaller than the number of processed elements, the output shape would be empty. However, the valid region will be empty if the input's first dimension is less than the number of elements processed. That required the changes in TensorShape. Change-Id: I36fed7893dfd502e26c5c776c9a2d774d6cd91c6 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79813 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Diffstat (limited to 'arm_compute/core/TensorShape.h')
-rw-r--r--arm_compute/core/TensorShape.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/arm_compute/core/TensorShape.h b/arm_compute/core/TensorShape.h
index f8b3181686..17348e4fc6 100644
--- a/arm_compute/core/TensorShape.h
+++ b/arm_compute/core/TensorShape.h
@@ -73,7 +73,13 @@ public:
*/
void set(size_t dimension, size_t value)
{
- ARM_COMPUTE_ERROR_ON(value < 1);
+ // Clear entire shape if one dimension is zero
+ if(value == 0)
+ {
+ _num_dimensions = 0;
+ std::fill(_id.begin(), _id.end(), 0);
+ return;
+ }
// Make sure all empty dimensions are filled with 1
std::fill(_id.begin() + _num_dimensions, _id.end(), 1);