ArmNN
 21.02
ComparisonSerializationTests.cpp File Reference
#include "../Serializer.hpp"
#include "SerializerTestUtils.hpp"
#include <armnn/Descriptors.hpp>
#include <armnn/INetwork.hpp>
#include <armnn/IRuntime.hpp>
#include <armnnDeserializer/IDeserializer.hpp>
#include <armnn/utility/IgnoreUnused.hpp>
#include <boost/test/unit_test.hpp>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (SerializeEqual)
 
 BOOST_AUTO_TEST_CASE (SerializeGreater)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/2]

BOOST_AUTO_TEST_CASE ( SerializeEqual  )

Definition at line 85 of file ComparisonSerializationTests.cpp.

References armnn::Boolean, DeserializeNetwork(), armnn::Equal, armnn::Float32, and SerializeNetwork().

86 {
87  const std::string layerName("equal");
88 
89  const armnn::TensorShape shape{2, 1, 2, 4};
92 
94 
95  ComparisonModel model(layerName, inputInfo, outputInfo, descriptor);
96 
97  armnn::INetworkPtr deserializedNetwork = DeserializeNetwork(SerializeNetwork(*model.m_network));
98  BOOST_CHECK(deserializedNetwork);
99 
100  ComparisonLayerVerifier verifier(layerName, { inputInfo, inputInfo }, { outputInfo }, descriptor);
101  deserializedNetwork->ExecuteStrategy(verifier);
102 }
armnn::INetworkPtr DeserializeNetwork(const std::string &serializerString)
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:78
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
Definition: INetwork.hpp:173
std::string SerializeNetwork(const armnn::INetwork &network)

◆ BOOST_AUTO_TEST_CASE() [2/2]

BOOST_AUTO_TEST_CASE ( SerializeGreater  )

Definition at line 104 of file ComparisonSerializationTests.cpp.

References armnn::Boolean, BOOST_AUTO_TEST_SUITE_END(), DeserializeNetwork(), armnn::Float32, armnn::Greater, and SerializeNetwork().

105 {
106  const std::string layerName("greater");
107 
108  const armnn::TensorShape shape{2, 1, 2, 4};
111 
113 
114  ComparisonModel model(layerName, inputInfo, outputInfo, descriptor);
115 
116  armnn::INetworkPtr deserializedNetwork = DeserializeNetwork(SerializeNetwork(*model.m_network));
117  BOOST_CHECK(deserializedNetwork);
118 
119  ComparisonLayerVerifier verifier(layerName, { inputInfo, inputInfo }, { outputInfo }, descriptor);
120  deserializedNetwork->ExecuteStrategy(verifier);
121 }
armnn::INetworkPtr DeserializeNetwork(const std::string &serializerString)
A ComparisonDescriptor for the ComparisonLayer.
Definition: Descriptors.hpp:78
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
Definition: INetwork.hpp:173
std::string SerializeNetwork(const armnn::INetwork &network)