From 721e629fa07e65d6a53c093518021e71e48eeac2 Mon Sep 17 00:00:00 2001 From: Keith Davis Date: Tue, 17 May 2022 10:06:53 +0100 Subject: 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 Change-Id: I3407815bfdc1cdc01ca0a667b8e4d80d8621783f --- src/backends/cl/test/ClImportTensorHandleTests.cpp | 37 +++++++++++----------- 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'src/backends/cl/test') 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); -- cgit v1.2.1