aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/test/SubgraphViewTests.cpp
diff options
context:
space:
mode:
authorMike Kelly <mike.kelly@arm.com>2023-03-31 18:00:00 +0100
committerMike Kelly <mike.kelly@arm.com>2023-03-31 18:03:19 +0100
commit1a05aad6d5adf3b25848ffd873a0e0e82756aa06 (patch)
tree973583209a4eeb916b42922189dc312a4d1effa2 /src/armnn/test/SubgraphViewTests.cpp
parentc4fb0dd4145e05123c546458ba5d281abfcc2b28 (diff)
downloadarmnn-1a05aad6d5adf3b25848ffd873a0e0e82756aa06.tar.gz
Revert "IVGCVSW-3808 Deprecation notices for old ElementwiseBinary layers"
This reverts commit 52e90bf59ecbe90d33368d8fc1fd120f07658aaf. Change-Id: I5a0d244593d8e760ee7ba0c9d38c02377e1bdc24 Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Diffstat (limited to 'src/armnn/test/SubgraphViewTests.cpp')
-rw-r--r--src/armnn/test/SubgraphViewTests.cpp45
1 files changed, 18 insertions, 27 deletions
diff --git a/src/armnn/test/SubgraphViewTests.cpp b/src/armnn/test/SubgraphViewTests.cpp
index 4fcb476fcf..e0fd5fe7c1 100644
--- a/src/armnn/test/SubgraphViewTests.cpp
+++ b/src/armnn/test/SubgraphViewTests.cpp
@@ -1054,7 +1054,7 @@ TEST_CASE("MultiInputSingleOutput")
auto layerX2 = graph.AddLayer<InputLayer>(1, "layerX2");
auto layerM1 = graph.AddLayer<ActivationLayer>(activationDefaults, "layerM1");
auto layerM2 = graph.AddLayer<ActivationLayer>(activationDefaults, "layerM2");
- auto layerM3 = graph.AddLayer<ElementwiseBinaryLayer>(BinaryOperation::Add, "layerM3");
+ auto layerM3 = graph.AddLayer<AdditionLayer>("layerM3");
auto layerX3 = graph.AddLayer<OutputLayer>(0, "layerX3");
// X1 X2
@@ -1081,7 +1081,7 @@ TEST_CASE("MultiInputSingleOutput")
[](const Layer & l)
{
bool toSelect = (l.GetType() == LayerType::Activation
- || l.GetType() == LayerType::ElementwiseBinary);
+ || l.GetType() == LayerType::Addition);
return toSelect;
});
@@ -1772,7 +1772,7 @@ TEST_CASE("SubgraphCycles")
auto m0 = graph.AddLayer<ActivationLayer>(ActivationDescriptor{}, "m0");
auto x1 = graph.AddLayer<ActivationLayer>(ActivationDescriptor{}, "x1");
auto m1 = graph.AddLayer<ActivationLayer>(ActivationDescriptor{}, "m1");
- auto m2 = graph.AddLayer<ElementwiseBinaryLayer>(BinaryOperation::Add, "m2");
+ auto m2 = graph.AddLayer<AdditionLayer>("m2");
auto x2 = graph.AddLayer<ActivationLayer>(ActivationDescriptor{}, "x2");
x0->GetOutputSlot(0).Connect(m0->GetInputSlot(0));
@@ -1872,7 +1872,7 @@ TEST_CASE("SubgraphViewWorkingCopy")
bool ReplaceConstantMultiplicationWithDepthwise(SubgraphView& subgraph,
IConnectableLayer* layer)
{
- if (layer->GetType() == LayerType::ElementwiseBinary)
+ if (layer->GetType() == LayerType::Multiplication)
{
IInputSlot* patternSubgraphInput = &layer->GetInputSlot(0);
IInputSlot* patternSubgraphConstant = &layer->GetInputSlot(1);
@@ -1937,12 +1937,12 @@ bool ReplaceConstantMultiplicationWithDepthwise(SubgraphView& subgraph,
bool ReplaceTestMultiplication(SubgraphView& subgraph,
IConnectableLayer* layer)
{
- if (layer->GetType() == LayerType::ElementwiseBinary)
+ if (layer->GetType() == LayerType::Multiplication)
{
switch (layer->GetType())
{
- case LayerType::ElementwiseBinary:
+ case LayerType::Multiplication:
return ReplaceConstantMultiplicationWithDepthwise(subgraph, layer);
break;
default:
@@ -1993,7 +1993,7 @@ TEST_CASE("SubgraphViewWorkingCopyReplacementFunc")
auto constant = graph.AddLayer<ConstantLayer>("const");
constant->m_LayerOutput = std::make_shared<ScopedTensorHandle>(constTensor);
- IConnectableLayer* mul = graph.AddLayer<ElementwiseBinaryLayer>(BinaryOperation::Mul, "mul");
+ IConnectableLayer* mul = graph.AddLayer<MultiplicationLayer>("mul");
IConnectableLayer* output = graph.AddLayer<OutputLayer>(0, "output");
// Create connections between layers
@@ -2015,10 +2015,7 @@ TEST_CASE("SubgraphViewWorkingCopyReplacementFunc")
// Check the WorkingCopy is as expected before replacement
CHECK(workingCopy.GetIConnectableLayers().size() == 4);
int idx=0;
- LayerType expectedSorted[] = {LayerType::Input,
- LayerType::Constant,
- LayerType::ElementwiseBinary,
- LayerType::Output};
+ LayerType expectedSorted[] = {LayerType::Input, LayerType::Constant, LayerType::Multiplication, LayerType::Output};
workingCopy.ForEachIConnectableLayer([&idx, &expectedSorted](const IConnectableLayer* l)
{
CHECK((expectedSorted[idx] == l->GetType()));
@@ -2212,7 +2209,7 @@ TEST_CASE("SubgraphViewWorkingCopyOptimizationViews")
auto constant = graph.AddLayer<ConstantLayer>("const");
constant->m_LayerOutput = std::make_shared<ScopedTensorHandle>(constTensor);
- IConnectableLayer* mul = graph.AddLayer<ElementwiseBinaryLayer>(BinaryOperation::Mul, "mul");
+ IConnectableLayer* mul = graph.AddLayer<MultiplicationLayer>("mul");
IConnectableLayer* output = graph.AddLayer<OutputLayer>(0, "output");
// Create connections between layers
@@ -2233,10 +2230,7 @@ TEST_CASE("SubgraphViewWorkingCopyOptimizationViews")
// Check the WorkingCopy is as expected before replacement
int idx=0;
- LayerType expectedSorted[] = {LayerType::Input,
- LayerType::Constant,
- LayerType::ElementwiseBinary,
- LayerType::Output};
+ LayerType expectedSorted[] = {LayerType::Input, LayerType::Constant, LayerType::Multiplication, LayerType::Output};
workingCopy.ForEachIConnectableLayer([&idx, &expectedSorted](const IConnectableLayer* l)
{
CHECK((expectedSorted[idx] == l->GetType()));
@@ -2291,7 +2285,7 @@ TEST_CASE("SubgraphViewWorkingCopyReplaceSlots")
auto constant = graph.AddLayer<ConstantLayer>("const");
constant->m_LayerOutput = std::make_shared<ScopedTensorHandle>(constTensor);
- IConnectableLayer* mul = graph.AddLayer<ElementwiseBinaryLayer>(BinaryOperation::Mul, "mul");
+ IConnectableLayer* mul = graph.AddLayer<MultiplicationLayer>("mul");
IConnectableLayer* output = graph.AddLayer<OutputLayer>(0, "output");
// Create connections between layers
@@ -2312,10 +2306,7 @@ TEST_CASE("SubgraphViewWorkingCopyReplaceSlots")
// Check the WorkingCopy is as expected before replacement
CHECK(workingCopy.GetIConnectableLayers().size() == 4);
int idx=0;
- LayerType expectedSorted[] = {LayerType::Input,
- LayerType::Constant,
- LayerType::ElementwiseBinary,
- LayerType::Output};
+ LayerType expectedSorted[] = {LayerType::Input, LayerType::Constant, LayerType::Multiplication, LayerType::Output};
workingCopy.ForEachIConnectableLayer([&idx, &expectedSorted](const IConnectableLayer* l)
{
CHECK((expectedSorted[idx] == l->GetType()));
@@ -2355,7 +2346,7 @@ TEST_CASE("SubgraphViewWorkingCopyCloneInputAndOutputSlots")
auto constant = graph.AddLayer<ConstantLayer>("const");
constant->m_LayerOutput = std::make_shared<ScopedTensorHandle>(constTensor);
- IConnectableLayer* mul = graph.AddLayer<ElementwiseBinaryLayer>(BinaryOperation::Mul, "mul");
+ IConnectableLayer* mul = graph.AddLayer<MultiplicationLayer>("mul");
armnn::ViewsDescriptor splitterDesc(2,4);
IConnectableLayer* split = graph.AddLayer<SplitterLayer>(splitterDesc, "split");
IConnectableLayer* abs = graph.AddLayer<ActivationLayer>(ActivationFunction::Abs, "abs");
@@ -2420,7 +2411,7 @@ TEST_CASE("SubgraphViewWorkingCopyCloneInputAndOutputSlots")
CHECK(workingCopy.GetIConnectableLayers().size() == 4);
int idx=0;
LayerType expectedSorted[] = {LayerType::Constant,
- LayerType::ElementwiseBinary,
+ LayerType::Multiplication,
LayerType::Splitter,
LayerType::Activation};
workingCopy.ForEachIConnectableLayer([&idx, &expectedSorted](const IConnectableLayer* l)
@@ -2541,7 +2532,7 @@ TEST_CASE("MultipleInputMultipleOutputSlots_SubstituteGraph")
Layer* convLayer = graph.AddLayer<Convolution2dLayer>(Convolution2dDescriptor(), "conv");
Layer* reluLayer = graph.AddLayer<ActivationLayer>(ActivationDescriptor(), "activation");
Layer* constLayer = graph.AddLayer<ConstantLayer>("const");
- Layer* addLayer = graph.AddLayer<ElementwiseBinaryLayer>(BinaryOperation::Add, "add");
+ Layer* addLayer = graph.AddLayer<AdditionLayer>("add");
Layer* outputLayer1 = graph.AddLayer<OutputLayer>(0, "output1");
Layer* outputLayer2 = graph.AddLayer<OutputLayer>(1, "output2");
@@ -2592,7 +2583,7 @@ TEST_CASE("MultipleInputMultipleOutputSlots_SubstituteGraph")
// GetWorkingCopy() has caused address pointer of convolution layer to change.
// Finding new address pointer...
- if (layer->GetType() == LayerType::ElementwiseBinary)
+ if (layer->GetType() == LayerType::Addition)
{
addCopyLayer = layer;
}
@@ -2643,7 +2634,7 @@ TEST_CASE("MultipleInputMultipleOutputSlots_SubstituteGraphNewSlots")
Layer* convLayer = graph.AddLayer<Convolution2dLayer>(Convolution2dDescriptor(), "conv");
Layer* reluLayer = graph.AddLayer<ActivationLayer>(ActivationDescriptor(), "activation");
Layer* constLayer = graph.AddLayer<ConstantLayer>("const");
- Layer* addLayer = graph.AddLayer<ElementwiseBinaryLayer>(BinaryOperation::Add, "add");
+ Layer* addLayer = graph.AddLayer<AdditionLayer>("add");
Layer* outputLayer1 = graph.AddLayer<OutputLayer>(0, "output1");
Layer* outputLayer2 = graph.AddLayer<OutputLayer>(1, "output2");
@@ -2669,7 +2660,7 @@ TEST_CASE("MultipleInputMultipleOutputSlots_SubstituteGraphNewSlots")
{
// GetWorkingCopy() has caused address pointer of convolution layer to change.
// Finding new address pointer...
- if (layer->GetType() == LayerType::ElementwiseBinary)
+ if (layer->GetType() == LayerType::Addition)
{
addCopyLayer = layer;
}