diff options
author | Keith Davis <keith.davis@arm.com> | 2022-05-17 10:06:53 +0100 |
---|---|---|
committer | Keith Davis <keith.davis@arm.com> | 2022-05-23 09:59:34 +0100 |
commit | 721e629fa07e65d6a53c093518021e71e48eeac2 (patch) | |
tree | 1f3826741777e5d2cb28be964f46163f49abc271 /src/backends/cl/test/ClImportTensorHandleTests.cpp | |
parent | 4a09159930f37dffa51c194ea8b565612bbe8431 (diff) | |
download | armnn-721e629fa07e65d6a53c093518021e71e48eeac2.tar.gz |
IVGCVSW-6123 ConstTensorsAsInputs: Conv2d
* Use new INetwork::AddConvolution2dLayer
instead of deprecated version
* Remove duplicated test in SerlializerTests
* Fix some cosmetics
Signed-off-by: Keith Davis <keith.davis@arm.com>
Change-Id: I3407815bfdc1cdc01ca0a667b8e4d80d8621783f
Diffstat (limited to 'src/backends/cl/test/ClImportTensorHandleTests.cpp')
-rw-r--r-- | src/backends/cl/test/ClImportTensorHandleTests.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/backends/cl/test/ClImportTensorHandleTests.cpp b/src/backends/cl/test/ClImportTensorHandleTests.cpp index 9bfd1fb46d..20537b3c81 100644 --- a/src/backends/cl/test/ClImportTensorHandleTests.cpp +++ b/src/backends/cl/test/ClImportTensorHandleTests.cpp @@ -320,14 +320,14 @@ TEST_CASE_FIXTURE(ClContextControlFixture, "ClForceImportConv2dEndToEnd") convDesc2d.m_PadBottom = 1; convDesc2d.m_DataLayout = DataLayout::NHWC; - ARMNN_NO_DEPRECATE_WARN_BEGIN - armnn::IConnectableLayer* const convLayer = network->AddConvolution2dLayer(convDesc2d, - weights, - armnn::EmptyOptional(), - "conv"); - ARMNN_NO_DEPRECATE_WARN_END + armnn::IConnectableLayer* const convLayer = network->AddConvolution2dLayer(convDesc2d, "conv"); + armnn::IConnectableLayer* weightsLayer = network->AddConstantLayer(weights); + ARMNN_ASSERT(convLayer); + weightsLayer->GetOutputSlot(0).SetTensorInfo(weights.GetInfo()); + weightsLayer->GetOutputSlot(0).Connect(convLayer->GetInputSlot(1u)); + inputLayer->GetOutputSlot(0).Connect(convLayer->GetInputSlot(0)); inputLayer->GetOutputSlot(0).SetTensorInfo(inputInfo); @@ -878,14 +878,14 @@ TEST_CASE_FIXTURE(ClContextControlFixture, "ClForceImportRepeatedInferencesEndTo convDesc2d.m_PadTop = 1; convDesc2d.m_PadBottom = 1; convDesc2d.m_DataLayout = DataLayout::NHWC; - ARMNN_NO_DEPRECATE_WARN_BEGIN - armnn::IConnectableLayer* const convLayer = network->AddConvolution2dLayer(convDesc2d, - weights, - armnn::EmptyOptional(), - "conv"); - ARMNN_NO_DEPRECATE_WARN_END + armnn::IConnectableLayer* const convLayer = network->AddConvolution2dLayer(convDesc2d, "conv"); ARMNN_ASSERT(convLayer); + armnn::IConnectableLayer* weightsLayer = network->AddConstantLayer(weights); + + weightsLayer->GetOutputSlot(0).SetTensorInfo(weights.GetInfo()); + weightsLayer->GetOutputSlot(0).Connect(convLayer->GetInputSlot(1u)); + inputLayer->GetOutputSlot(0).Connect(convLayer->GetInputSlot(0)); inputLayer->GetOutputSlot(0).SetTensorInfo(inputInfo); @@ -1098,14 +1098,15 @@ TEST_CASE_FIXTURE(ClContextControlFixture, "ClForceImportRepeatedInferencesInver convDesc2d.m_PadTop = 1; convDesc2d.m_PadBottom = 1; convDesc2d.m_DataLayout = DataLayout::NHWC; - ARMNN_NO_DEPRECATE_WARN_BEGIN - armnn::IConnectableLayer* const convLayer = network->AddConvolution2dLayer(convDesc2d, - weights, - armnn::EmptyOptional(), - "conv"); - ARMNN_NO_DEPRECATE_WARN_END + + armnn::IConnectableLayer* const convLayer = network->AddConvolution2dLayer(convDesc2d, "conv"); ARMNN_ASSERT(convLayer); + armnn::IConnectableLayer* weightsLayer = network->AddConstantLayer(weights); + + weightsLayer->GetOutputSlot(0).SetTensorInfo(weights.GetInfo()); + weightsLayer->GetOutputSlot(0).Connect(convLayer->GetInputSlot(1u)); + inputLayer->GetOutputSlot(0).Connect(convLayer->GetInputSlot(0)); inputLayer->GetOutputSlot(0).SetTensorInfo(inputInfo); |