diff options
Diffstat (limited to 'src/armnnSerializer/test')
-rw-r--r-- | src/armnnSerializer/test/SerializerTestUtils.hpp | 1 | ||||
-rw-r--r-- | src/armnnSerializer/test/SerializerTests.cpp | 17 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/armnnSerializer/test/SerializerTestUtils.hpp b/src/armnnSerializer/test/SerializerTestUtils.hpp index c6f148b1a1..ce4d2cc330 100644 --- a/src/armnnSerializer/test/SerializerTestUtils.hpp +++ b/src/armnnSerializer/test/SerializerTestUtils.hpp @@ -69,6 +69,7 @@ public: { case armnn::LayerType::Input: break; case armnn::LayerType::Output: break; + case armnn::LayerType::Constant: break; default: { VerifyNameAndConnections(layer, name); diff --git a/src/armnnSerializer/test/SerializerTests.cpp b/src/armnnSerializer/test/SerializerTests.cpp index f2c9852607..2bffe0b9fd 100644 --- a/src/armnnSerializer/test/SerializerTests.cpp +++ b/src/armnnSerializer/test/SerializerTests.cpp @@ -472,25 +472,26 @@ TEST_CASE("SerializeConvolution3d") armnn::INetworkPtr network = armnn::INetwork::Create(); armnn::IConnectableLayer* const inputLayer = network->AddInputLayer(0); - armnn::IConnectableLayer* const convLayer = - network->AddConvolution3dLayer(descriptor, - weights, - armnn::Optional<armnn::ConstTensor>(biases), - layerName.c_str()); + armnn::IConnectableLayer* const weightsLayer = network->AddConstantLayer(weights, "Weights"); + armnn::IConnectableLayer* const biasesLayer = network->AddConstantLayer(biases, "Biases"); + armnn::IConnectableLayer* const convLayer = network->AddConvolution3dLayer(descriptor, layerName.c_str()); armnn::IConnectableLayer* const outputLayer = network->AddOutputLayer(0); inputLayer->GetOutputSlot(0).Connect(convLayer->GetInputSlot(0)); + weightsLayer->GetOutputSlot(0).Connect(convLayer->GetInputSlot(1)); + biasesLayer->GetOutputSlot(0).Connect(convLayer->GetInputSlot(2)); convLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0)); inputLayer->GetOutputSlot(0).SetTensorInfo(inputInfo); + weightsLayer->GetOutputSlot(0).SetTensorInfo(weightsInfo); + biasesLayer->GetOutputSlot(0).SetTensorInfo(biasesInfo); convLayer->GetOutputSlot(0).SetTensorInfo(outputInfo); armnn::INetworkPtr deserializedNetwork = DeserializeNetwork(SerializeNetwork(*network)); CHECK(deserializedNetwork); - const std::vector<armnn::ConstTensor>& constants {weights, biases}; - LayerVerifierBaseWithDescriptorAndConstants<armnn::Convolution3dDescriptor> verifier( - layerName, {inputInfo}, {outputInfo}, descriptor, constants); + LayerVerifierBaseWithDescriptor<armnn::Convolution3dDescriptor> verifier( + layerName, {inputInfo, weightsInfo, biasesInfo}, {outputInfo}, descriptor); deserializedNetwork->ExecuteStrategy(verifier); } |