diff options
author | Matthew Sloyan <matthew.sloyan@arm.com> | 2021-05-07 14:18:01 +0000 |
---|---|---|
committer | Matthew Sloyan <matthew.sloyan@arm.com> | 2021-05-07 17:01:11 +0000 |
commit | ae12306486efc55293a40048618abe5e8b19151b (patch) | |
tree | c2aaadcbe987885a3ed5629f36759b1ff9c62c86 /src/backends/aclCommon/ArmComputeUtils.hpp | |
parent | 67ac7fac3453fbeaa146a5b52f688a5b804296c2 (diff) | |
download | armnn-ae12306486efc55293a40048618abe5e8b19151b.tar.gz |
Revert "MLCE-418 Reduce layer does not support multiple axes"
This reverts commit d905decd256558bbee165e636ce4242ac3b9c917.
Reason for revert: LargeGraph_TENSOR_FLOAT32/FLOAT16 CTS tests failures
Change-Id: Ie69826549e73775825f45134375b5b2c41aebd01
Diffstat (limited to 'src/backends/aclCommon/ArmComputeUtils.hpp')
-rw-r--r-- | src/backends/aclCommon/ArmComputeUtils.hpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/src/backends/aclCommon/ArmComputeUtils.hpp b/src/backends/aclCommon/ArmComputeUtils.hpp index 5bc5abcb05..d9efab288f 100644 --- a/src/backends/aclCommon/ArmComputeUtils.hpp +++ b/src/backends/aclCommon/ArmComputeUtils.hpp @@ -7,7 +7,6 @@ #include <armnn/Descriptors.hpp> #include <armnn/Tensor.hpp> #include <armnn/utility/Assert.hpp> -#include <armnn/utility/NumericCast.hpp> #include <backendsCommon/WorkloadData.hpp> #include <arm_compute/core/Types.h> @@ -268,58 +267,4 @@ inline arm_compute::ReductionOperation ConvertReductionOperationToAcl(const Redu } } -/// Function to compute the output tensor shape based on the axes and if keepDims is set. -inline const TensorShape ComputeReductionTensorShape(const armnn::TensorInfo& input, - const std::vector<uint32_t>& vAxis, - const bool keepDims) -{ - unsigned int rank = input.GetNumDimensions(); - unsigned int outputRank = 0; - - // Calculate output dimension - if (keepDims) - { - outputRank = rank; - } - else if (vAxis.empty()) - { - outputRank = 1; - } - else if (vAxis.size() > input.GetNumDimensions()) - { - throw LayerValidationException("ReduceLayer: Dimensions to reduce can not be bigger than input dimensions"); - } - else - { - outputRank = input.GetNumDimensions() - armnn::numeric_cast<unsigned int>(vAxis.size()); - if (outputRank == 0) - { - outputRank = 1; - } - } - - std::vector<unsigned int> dimSizes(outputRank, 1); - if (!vAxis.empty()) - { - // Skip the dimension that has been reduced unless keepDims is true. - unsigned int outputIndex = 0; - for (unsigned int i = 0; i < input.GetNumDimensions(); ++i) - { - if (std::find(vAxis.begin(), vAxis.end(), i) == vAxis.end()) - { - dimSizes[outputIndex] = armnn::numeric_cast<unsigned int>(input.GetShape()[i]); - ++outputIndex; - } - else if (keepDims) - { - dimSizes[outputIndex] = 1; - ++outputIndex; - } - } - } - - const TensorShape inferredShape = TensorShape(outputRank, dimSizes.data()); - return inferredShape; -} - } // namespace armnn |