MCPcopy Create free account
hub / github.com/ARM-software/armnn / SerializeArgMinMaxTest

Function SerializeArgMinMaxTest

src/armnnSerializer/test/SerializerTests.cpp:56–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void SerializeArgMinMaxTest(armnn::DataType dataType)
57{
58 const std::string layerName("argminmax");
59 const armnn::TensorInfo inputInfo({1, 2, 3}, armnn::DataType::Float32);
60 const armnn::TensorInfo outputInfo({1, 3}, dataType);
61
62 armnn::ArgMinMaxDescriptor descriptor;
63 descriptor.m_Function = armnn::ArgMinMaxFunction::Max;
64 descriptor.m_Axis = 1;
65
66 armnn::INetworkPtr network = armnn::INetwork::Create();
67 armnn::IConnectableLayer* const inputLayer = network->AddInputLayer(0);
68 armnn::IConnectableLayer* const argMinMaxLayer = network->AddArgMinMaxLayer(descriptor, layerName.c_str());
69 armnn::IConnectableLayer* const outputLayer = network->AddOutputLayer(0);
70
71 inputLayer->GetOutputSlot(0).Connect(argMinMaxLayer->GetInputSlot(0));
72 argMinMaxLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0));
73
74 inputLayer->GetOutputSlot(0).SetTensorInfo(inputInfo);
75 argMinMaxLayer->GetOutputSlot(0).SetTensorInfo(outputInfo);
76
77 armnn::INetworkPtr deserializedNetwork = DeserializeNetwork(SerializeNetwork(*network));
78 CHECK(deserializedNetwork);
79
80 LayerVerifierBaseWithDescriptor<armnn::ArgMinMaxDescriptor> verifier(layerName,
81 {inputInfo},
82 {outputInfo},
83 descriptor);
84 deserializedNetwork->ExecuteStrategy(verifier);
85}
86
87TEST_CASE("SerializeArgMinMaxSigned32")
88{

Callers 1

Calls 10

DeserializeNetworkFunction · 0.85
AddArgMinMaxLayerMethod · 0.80
GetOutputSlotMethod · 0.80
SerializeNetworkFunction · 0.70
AddInputLayerMethod · 0.45
c_strMethod · 0.45
AddOutputLayerMethod · 0.45
ConnectMethod · 0.45
SetTensorInfoMethod · 0.45
ExecuteStrategyMethod · 0.45

Tested by

no test coverage detected