aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/TensorShape.h
diff options
context:
space:
mode:
authorDiego Lopez Recas <Diego.LopezRecas@arm.com>2017-12-04 18:56:10 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:45:00 +0000
commit35ceeb2199c569810a1524a0a21c2df2a3f5f29e (patch)
tree4a55f8626cb2960843547fabdb2431a70ec1029a /arm_compute/core/TensorShape.h
parent97cf2497d2b617de3209330893ad51bd0cc126ce (diff)
downloadComputeLibrary-35ceeb2199c569810a1524a0a21c2df2a3f5f29e.tar.gz
IVGCVSW-798 Add Softmax NEON support for QASYMM8
Change-Id: I4f2cca52caf210fdb7d6bb7e9436ac51cb5088b4 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/112398 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/TensorShape.h')
-rw-r--r--arm_compute/core/TensorShape.h26
1 files changed, 15 insertions, 11 deletions
diff --git a/arm_compute/core/TensorShape.h b/arm_compute/core/TensorShape.h
index ad102607e8..50f1211c18 100644
--- a/arm_compute/core/TensorShape.h
+++ b/arm_compute/core/TensorShape.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -70,26 +70,30 @@ public:
*
* @param[in] dimension Dimension for which the value is set.
* @param[in] value Value to be set for the dimension.
+ *
+ * @return *this.
*/
- void set(size_t dimension, size_t value)
+ TensorShape &set(size_t dimension, size_t value)
{
// Clear entire shape if one dimension is zero
if(value == 0)
{
_num_dimensions = 0;
std::fill(_id.begin(), _id.end(), 0);
- return;
}
+ else
+ {
+ // Make sure all empty dimensions are filled with 1
+ std::fill(_id.begin() + _num_dimensions, _id.end(), 1);
- // Make sure all empty dimensions are filled with 1
- std::fill(_id.begin() + _num_dimensions, _id.end(), 1);
-
- // Set the specified dimension and increase the number of dimensions if
- // necessary
- Dimensions::set(dimension, value);
+ // Set the specified dimension and increase the number of dimensions if
+ // necessary
+ Dimensions::set(dimension, value);
- // Correct number dimensions to ignore trailing dimensions of size 1
- apply_dimension_correction();
+ // Correct number dimensions to ignore trailing dimensions of size 1
+ apply_dimension_correction();
+ }
+ return *this;
}
/** Accessor to remove the dimension n from the tensor shape.