diff options
author | Tianle Cheng <tianle.cheng@arm.com> | 2023-12-12 13:52:22 +0000 |
---|---|---|
committer | Tianle Cheng <tianle.cheng@arm.com> | 2023-12-15 10:22:31 +0000 |
commit | 7790dc6531034778d92ba264fd61174bcff7051e (patch) | |
tree | fe24f0a8a1229296168db559501a7403d5cbf962 /src/backends/tosaCommon/operatorMappings/ElementwiseBinaryOperator.cpp | |
parent | f0d8ec1f4be3ce5794a48c3d3449fe93f2e58d04 (diff) | |
download | armnn-7790dc6531034778d92ba264fd61174bcff7051e.tar.gz |
IVGCVSW-8113 Update EndToEnd tests and TosaReference support for Maximum
* Added ElementwiseBinary EndToEnd tests with inputs of the same shape to avoid Reshape
* Added Slice EndToEnd tests with 4D tensors
* Added TosaReference support for Maximum and TosaRefEndToEnd tests
Signed-off-by: Tianle Cheng <tianle.cheng@arm.com>
Change-Id: I4fa24435a75559e00b110d0e542b4f2bf07b21b4
Diffstat (limited to 'src/backends/tosaCommon/operatorMappings/ElementwiseBinaryOperator.cpp')
-rw-r--r-- | src/backends/tosaCommon/operatorMappings/ElementwiseBinaryOperator.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/backends/tosaCommon/operatorMappings/ElementwiseBinaryOperator.cpp b/src/backends/tosaCommon/operatorMappings/ElementwiseBinaryOperator.cpp index 28e7ec8231..6c2b31437b 100644 --- a/src/backends/tosaCommon/operatorMappings/ElementwiseBinaryOperator.cpp +++ b/src/backends/tosaCommon/operatorMappings/ElementwiseBinaryOperator.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -8,7 +8,8 @@ TosaSerializationBasicBlock* ConvertElementwiseBinaryToTosaOperator(const Layer* layer, const LayerType type, const std::vector<const TensorInfo*>& inputs, - const std::vector<const TensorInfo*>& outputs) + const std::vector<const TensorInfo*>& outputs, + const ElementwiseBinaryDescriptor* descriptor) { std::string input0Name = std::string("input0_"); std::string input1Name = std::string("input1_"); @@ -43,6 +44,25 @@ TosaSerializationBasicBlock* ConvertElementwiseBinaryToTosaOperator(const Layer* blockName = std::string("Op_ADD_block_") + GetUniqueTosaMappingID(); break; } + case LayerType::ElementwiseBinary: + { + switch (descriptor->m_Operation) + { + case armnn::BinaryOperation::Maximum: + { + op = new TosaSerializationOperator(Op_MAXIMUM, + Attribute_NONE, + nullptr, + {input0Name, input1Name}, + {outputName}); + blockName = std::string("Op_MAXIMUM_block_") + GetUniqueTosaMappingID(); + break; + } + default: + throw armnn::Exception("ConvertElementwiseBinaryToTosaOperator: Unsupported layer type."); + } + break; + } case LayerType::Multiplication: { int32_t shift = 0; |