diff options
author | Mike Kelly <mike.kelly@arm.com> | 2023-03-08 13:47:17 +0000 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2023-03-14 16:40:09 +0000 |
commit | 3ec3077b4eaedcc0c20ab5774bdbe365da541445 (patch) | |
tree | d601d2000897dec8691bf64cbddc9036f26b8034 /src/armnn/Network.cpp | |
parent | a088cd00b3cce672d26cdcb4965fc2a86b48f339 (diff) | |
download | armnn-3ec3077b4eaedcc0c20ab5774bdbe365da541445.tar.gz |
IVGCVSW-3808 Add ElementwiseBinaryLayer
!android-nn-driver:9329
* Added ElementwiseBinaryLayer that can represent all ElementwiseBinary
operations including Add, Div, Sub, Maximum, Mul and Minimum.
* Updated Delegate to use ElementwiseBinaryLayer instead of the Add,
Div, Sub, Maximum, Mul and Minimum layers.
* Updated Deserializer to use ElementwiseBinaryLayer instead of the Add,
Div, Sub, Maximum, Mul and Minimum layers.
* Updated OnnxParser to use ElementwiseBinaryLayer instead of the Add
layer.
* Updated TfLiteParser to use ElementwiseBinaryLayer instead of the Add,
Div, Sub, Maximum, Mul and Minimum layers.
* Updated CL and Neon tests to use ElementwiseBinaryLayer.
* Updated CL and Neon Backend Specific Optimizations to accept
ElementBinaryLayers as well as Add, Div, Mul, Sub, Maximum and Minimum
layers.
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Change-Id: I7cbb96b60eb01f0e2b57b0541016d48a08b86c75
Diffstat (limited to 'src/armnn/Network.cpp')
-rw-r--r-- | src/armnn/Network.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/armnn/Network.cpp b/src/armnn/Network.cpp index 08d3280cfe..9ebb67b593 100644 --- a/src/armnn/Network.cpp +++ b/src/armnn/Network.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2017, 2022-2023 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -20,7 +20,6 @@ #include <backendsCommon/TensorHandleFactoryRegistry.hpp> #include <armnn/Exceptions.hpp> -#include <armnn/Utils.hpp> #include <armnn/TypesUtils.hpp> #include <armnn/BackendRegistry.hpp> #include <armnn/Logging.hpp> @@ -36,10 +35,8 @@ #include <fcntl.h> #include <algorithm> -#include <fstream> #include <memory> #include <vector> -#include <algorithm> namespace armnn { @@ -58,7 +55,6 @@ IConnectableLayer* INetwork::AddInputLayer(LayerBindingId id, const char* name) return pNetworkImpl->AddInputLayer(id, name); } - IConnectableLayer* INetwork::AddArgMinMaxLayer(const ArgMinMaxDescriptor& desc, const char* name) { @@ -126,6 +122,11 @@ IConnectableLayer* INetwork::AddDetectionPostProcessLayer( return pNetworkImpl->AddDetectionPostProcessLayer(descriptor, anchors, name); } +IConnectableLayer* INetwork::AddElementwiseBinaryLayer(const ElementwiseBinaryDescriptor& elementwiseBinaryDescriptor, + const char* name) +{ + return pNetworkImpl->AddElementwiseBinaryLayer(elementwiseBinaryDescriptor, name); +} IConnectableLayer* INetwork::AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor& elementwiseUnaryDescriptor, const char* name) @@ -133,7 +134,6 @@ IConnectableLayer* INetwork::AddElementwiseUnaryLayer(const ElementwiseUnaryDesc return pNetworkImpl->AddElementwiseUnaryLayer(elementwiseUnaryDescriptor, name); } - IConnectableLayer* INetwork::AddFillLayer(const FillDescriptor& fillDescriptor, const char* name) { @@ -1853,6 +1853,12 @@ IConnectableLayer* NetworkImpl::AddComparisonLayer(const ComparisonDescriptor& c return m_Graph->AddLayer<ComparisonLayer>(comparisonDescriptor, name); } +IConnectableLayer* NetworkImpl::AddElementwiseBinaryLayer(const ElementwiseBinaryDescriptor& elementwiseBinaryDesc, + const char* name) +{ + return m_Graph->AddLayer<ElementwiseBinaryLayer>(elementwiseBinaryDesc, name); +} + IConnectableLayer* NetworkImpl::AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor& elementwiseUnaryDescriptor, const char* name) { |