From 35ceeb2199c569810a1524a0a21c2df2a3f5f29e Mon Sep 17 00:00:00 2001 From: Diego Lopez Recas Date: Mon, 4 Dec 2017 18:56:10 +0000 Subject: 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 Tested-by: Jenkins --- arm_compute/core/TensorShape.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'arm_compute/core/TensorShape.h') 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. -- cgit v1.2.1