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
diff --git a/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp b/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp
index cd865de..5e619df 100644
--- a/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp
+++ b/src/backends/backendsCommon/test/OptimizedNetworkTests.cpp
@@ -1,5 +1,5 @@
//
-// Copyright © 2017 Arm Ltd. All rights reserved.
+// Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
@@ -21,7 +21,7 @@
//Defines layers.
auto input = net->AddInputLayer(0);
- auto add = net->AddAdditionLayer();
+ auto add = net->AddElementwiseBinaryLayer(armnn::BinaryOperation::Add);
auto output = net->AddOutputLayer(0);
// Connects layers.
@@ -54,7 +54,7 @@
" edge [fontsize=8 fontcolor=\"blue\" fontname=\"arial-bold\"];\n"
" " << inputId << " [label=\"{Input|Guid : " << inputId << "\\lLayerType : Input\\l"
"BackendID : CpuRef\\l}\"];\n"
- " " << addId << " [label=\"{Addition|Guid : " << addId << "\\lLayerType : Addition\\l"
+ " " << addId << " [label=\"{ElementwiseBinary|Guid : " << addId << "\\lLayerType : ElementwiseBinary\\l"
"BackendID : CpuRef\\l}\"];\n"
" " << outputId << " [label=\"{Output|Guid : " << outputId << "\\lLayerType : Output\\l"
"BackendID : CpuRef\\l}\"];\n"
@@ -187,7 +187,7 @@
layer->GetOutputSlot(0).SetTensorInfo(desc);
armnn::IConnectableLayer* prevLayer = layer;
- layer = net->AddMultiplicationLayer("ml");
+ layer = net->AddElementwiseBinaryLayer(armnn::BinaryOperation::Mul, "ml");
prevLayer->GetOutputSlot(0).Connect(layer->GetInputSlot(0));
normLayer->GetOutputSlot(0).Connect(layer->GetInputSlot(1));
@@ -258,7 +258,7 @@
layer->GetOutputSlot(0).SetTensorInfo(desc);
armnn::IConnectableLayer* prevLayer = layer;
- layer = net->AddMultiplicationLayer("ml");
+ layer = net->AddElementwiseBinaryLayer(armnn::BinaryOperation::Mul, "ml");
prevLayer->GetOutputSlot(0).Connect(layer->GetInputSlot(0));
normLayer->GetOutputSlot(0).Connect(layer->GetInputSlot(1));