6 #include "../Serializer.hpp" 20 #include <boost/test/unit_test.hpp> 28 const std::string layerName(
"abs");
40 absLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0));
43 absLayer->GetOutputSlot(0).SetTensorInfo(tensorInfo);
46 BOOST_CHECK(deserializedNetwork);
54 const std::string layerName(
"addition");
73 BOOST_CHECK(deserializedNetwork);
81 const std::string layerName(
"argminmax");
87 descriptor.m_Axis = 1;
101 BOOST_CHECK(deserializedNetwork);
122 const std::string layerName(
"batchNormalization");
132 descriptor.
m_Eps = 0.0010000000475f;
135 std::vector<float> meanData({5.0});
136 std::vector<float> varianceData({2.0});
137 std::vector<float> betaData({1.0});
138 std::vector<float> gammaData({0.0});
140 std::vector<armnn::ConstTensor> constants;
149 network->AddBatchNormalizationLayer(descriptor,
164 BOOST_CHECK(deserializedNetwork);
167 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
173 const std::string layerName(
"spaceToBatchNd");
179 desc.m_BlockShape = {2, 2};
180 desc.m_Crops = {{0, 0}, {0, 0}};
194 BOOST_CHECK(deserializedNetwork);
205 const std::string layerName(
"cast");
224 BOOST_CHECK(deserializedNetwork);
232 const std::string layerName(
"comparison");
256 BOOST_CHECK(deserializedNetwork);
259 { inputInfo, inputInfo },
270 ConstantLayerVerifier(
const std::string& layerName,
271 const std::vector<armnn::TensorInfo>& inputInfos,
272 const std::vector<armnn::TensorInfo>& outputInfos,
273 const std::vector<armnn::ConstTensor>& constants)
275 , m_Constants(constants) {}
279 const std::vector<armnn::ConstTensor>& constants,
294 for (std::size_t i = 0; i < constants.size(); i++)
303 const std::vector<armnn::ConstTensor> m_Constants;
306 const std::string layerName(
"constant");
309 std::vector<float> constantData = GenerateRandomData<float>(info.GetNumElements());
327 BOOST_CHECK(deserializedNetwork);
329 ConstantLayerVerifier verifier(layerName, {}, {info}, {constTensor});
330 deserializedNetwork->ExecuteStrategy(verifier);
335 const std::string layerName(
"convolution2d");
342 std::vector<float> weightsData = GenerateRandomData<float>(weightsInfo.GetNumElements());
345 std::vector<float> biasesData = GenerateRandomData<float>(biasesInfo.GetNumElements());
363 network->AddConvolution2dLayer(descriptor,
376 BOOST_CHECK(deserializedNetwork);
378 const std::vector<armnn::ConstTensor>& constants {weights, biases};
380 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
386 using namespace armnn;
388 const std::string layerName(
"convolution2dWithPerAxis");
389 const TensorInfo inputInfo ({ 1, 3, 1, 2 }, DataType::QAsymmU8, 0.55f, 128);
390 const TensorInfo outputInfo({ 1, 3, 1, 3 }, DataType::QAsymmU8, 0.75f, 128);
392 const std::vector<float> quantScales{ 0.75f, 0.65f, 0.85f };
393 constexpr
unsigned int quantDimension = 0;
395 const TensorInfo kernelInfo({ 3, 1, 1, 2 }, DataType::QSymmS8, quantScales, quantDimension);
397 const std::vector<float> biasQuantScales{ 0.25f, 0.50f, 0.75f };
398 const TensorInfo biasInfo({ 3 }, DataType::Signed32, biasQuantScales, quantDimension);
400 std::vector<int8_t> kernelData = GenerateRandomData<int8_t>(kernelInfo.GetNumElements());
402 std::vector<int32_t> biasData = GenerateRandomData<int32_t>(biasInfo.GetNumElements());
418 network->AddConvolution2dLayer(descriptor,
431 BOOST_CHECK(deserializedNetwork);
433 const std::vector<armnn::ConstTensor>& constants {weights, biases};
435 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
441 const std::string layerName(
"depthToSpace");
462 BOOST_CHECK(deserializedNetwork);
470 const std::string layerName(
"depwiseConvolution2d");
477 std::vector<float> weightsData = GenerateRandomData<float>(weightsInfo.GetNumElements());
480 std::vector<int32_t> biasesData = GenerateRandomData<int32_t>(biasesInfo.GetNumElements());
498 network->AddDepthwiseConvolution2dLayer(descriptor,
511 BOOST_CHECK(deserializedNetwork);
513 const std::vector<armnn::ConstTensor>& constants {weights, biases};
515 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
521 using namespace armnn;
523 const std::string layerName(
"depwiseConvolution2dWithPerAxis");
524 const TensorInfo inputInfo ({ 1, 3, 3, 2 }, DataType::QAsymmU8, 0.55f, 128);
525 const TensorInfo outputInfo({ 1, 2, 2, 4 }, DataType::QAsymmU8, 0.75f, 128);
527 const std::vector<float> quantScales{ 0.75f, 0.80f, 0.90f, 0.95f };
528 const unsigned int quantDimension = 0;
529 TensorInfo kernelInfo({ 2, 2, 2, 2 }, DataType::QSymmS8, quantScales, quantDimension);
531 const std::vector<float> biasQuantScales{ 0.25f, 0.35f, 0.45f, 0.55f };
532 constexpr
unsigned int biasQuantDimension = 0;
533 TensorInfo biasInfo({ 4 }, DataType::Signed32, biasQuantScales, biasQuantDimension);
535 std::vector<int8_t> kernelData = GenerateRandomData<int8_t>(kernelInfo.GetNumElements());
537 std::vector<int32_t> biasData = GenerateRandomData<int32_t>(biasInfo.GetNumElements());
555 network->AddDepthwiseConvolution2dLayer(descriptor,
568 BOOST_CHECK(deserializedNetwork);
570 const std::vector<armnn::ConstTensor>& constants {weights, biases};
572 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
578 const std::string layerName(
"dequantize");
594 BOOST_CHECK(deserializedNetwork);
602 const std::string layerName(
"detectionPostProcess");
604 const std::vector<armnn::TensorInfo> inputInfos({
609 const std::vector<armnn::TensorInfo> outputInfos({
630 const std::vector<float> anchorsData({
631 0.5f, 0.5f, 1.0f, 1.0f,
632 0.5f, 0.5f, 1.0f, 1.0f,
633 0.5f, 0.5f, 1.0f, 1.0f,
634 0.5f, 10.5f, 1.0f, 1.0f,
635 0.5f, 10.5f, 1.0f, 1.0f,
636 0.5f, 100.5f, 1.0f, 1.0f
642 network->AddDetectionPostProcessLayer(descriptor, anchors, layerName.c_str());
644 for (
unsigned int i = 0; i < 2; i++)
651 for (
unsigned int i = 0; i < 4; i++)
659 BOOST_CHECK(deserializedNetwork);
661 const std::vector<armnn::ConstTensor>& constants {anchors};
663 layerName, inputInfos, outputInfos, descriptor, constants);
664 deserializedNetwork->ExecuteStrategy(verifier);
669 const std::string layerName(
"division");
687 BOOST_CHECK(deserializedNetwork);
695 const std::string layerName(
"EqualLayer");
712 equalLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0));
713 equalLayer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo);
716 BOOST_CHECK(deserializedNetwork);
718 LayerVerifierBase verifier(layerName, {inputTensorInfo1, inputTensorInfo2}, {outputTensorInfo});
724 const std::string layerName(
"fill");
742 BOOST_CHECK(deserializedNetwork);
751 const std::string layerName(
"floor");
766 BOOST_CHECK(deserializedNetwork);
774 const std::string layerName(
"fullyConnected");
780 std::vector<float> weightsData = GenerateRandomData<float>(weightsInfo.GetNumElements());
781 std::vector<float> biasesData = GenerateRandomData<float>(biasesInfo.GetNumElements());
793 network->AddFullyConnectedLayer(descriptor,
806 BOOST_CHECK(deserializedNetwork);
808 const std::vector<armnn::ConstTensor> constants {weights, biases};
810 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
816 const std::string layerName(
"fullyConnected_weights_as_inputs");
836 network->AddFullyConnectedLayer(descriptor,
853 BOOST_CHECK(deserializedNetwork);
855 const std::vector<armnn::ConstTensor> constants {};
857 layerName, {inputInfo, weightsInfo, biasesInfo}, {outputInfo}, descriptor, constants);
867 GatherLayerVerifier(
const std::string& layerName,
868 const std::vector<armnn::TensorInfo>& inputInfos,
869 const std::vector<armnn::TensorInfo>& outputInfos,
875 const std::vector<armnn::ConstTensor>& constants,
887 VerifyNameAndConnections(layer, name);
889 BOOST_CHECK(layerDescriptor.
m_Axis == m_Descriptor.m_Axis);
895 const std::string layerName(
"gather");
902 paramsInfo.SetQuantizationScale(1.0f);
903 paramsInfo.SetQuantizationOffset(0);
904 outputInfo.SetQuantizationScale(1.0f);
905 outputInfo.SetQuantizationOffset(0);
907 const std::vector<int32_t>& indicesData = {7, 6, 5};
925 BOOST_CHECK(deserializedNetwork);
927 GatherLayerVerifier verifier(layerName, {paramsInfo, indicesInfo}, {outputInfo}, descriptor);
928 deserializedNetwork->ExecuteStrategy(verifier);
937 const std::string layerName(
"greater");
954 equalLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0));
958 equalLayer->GetOutputSlot(0).SetTensorInfo(outputInfo);
961 BOOST_CHECK(deserializedNetwork);
970 const std::string layerName(
"instanceNormalization");
975 descriptor.m_Beta = 0.1f;
976 descriptor.m_Eps = 0.0001f;
982 network->AddInstanceNormalizationLayer(descriptor, layerName.c_str());
992 BOOST_CHECK(deserializedNetwork);
995 layerName, {
info}, {
info}, descriptor);
1001 const std::string l2NormLayerName(
"l2Normalization");
1006 desc.m_Eps = 0.0001f;
1020 BOOST_CHECK(deserializedNetwork);
1023 l2NormLayerName, {
info}, {
info}, desc);
1034 const std::vector<uint8_t> l2NormalizationModel =
1036 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x0A, 0x00,
1037 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
1038 0x3C, 0x01, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
1039 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xE8, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x0B,
1040 0x04, 0x00, 0x00, 0x00, 0xD6, 0xFE, 0xFF, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00,
1041 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x9E, 0xFF, 0xFF, 0xFF, 0x02, 0x00, 0x00, 0x00,
1042 0x10, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
1043 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1044 0x4C, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
1045 0x00, 0x20, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00,
1046 0x20, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x06, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
1047 0x0E, 0x00, 0x18, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x14, 0x00, 0x0E, 0x00, 0x00, 0x00,
1048 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x20, 0x00,
1049 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x6C, 0x32, 0x4E, 0x6F, 0x72, 0x6D, 0x61, 0x6C, 0x69, 0x7A, 0x61, 0x74,
1050 0x69, 0x6F, 0x6E, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00,
1051 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
1052 0x52, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
1053 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
1054 0x08, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1055 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
1056 0x04, 0x00, 0x00, 0x00, 0xF6, 0xFF, 0xFF, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0A, 0x00,
1057 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x00, 0x00,
1058 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00,
1059 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1060 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0A, 0x00, 0x00, 0x00,
1061 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x08, 0x00,
1062 0x07, 0x00, 0x0C, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
1063 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
1064 0x05, 0x00, 0x00, 0x00, 0x00
1068 DeserializeNetwork(std::string(l2NormalizationModel.begin(), l2NormalizationModel.end()));
1069 BOOST_CHECK(deserializedNetwork);
1071 const std::string layerName(
"l2Normalization");
1077 desc.m_Eps = 1e-12f;
1080 layerName, {inputInfo}, {inputInfo}, desc);
1086 const std::string layerName(
"logicalBinaryAnd");
1098 armnn::IConnectableLayer*
const logicalBinaryLayer = network->AddLogicalBinaryLayer(descriptor, layerName.c_str());
1110 BOOST_CHECK(deserializedNetwork);
1113 layerName, { inputInfo, inputInfo }, { outputInfo }, descriptor);
1119 const std::string layerName(
"elementwiseUnaryLogicalNot");
1131 network->AddElementwiseUnaryLayer(descriptor, layerName.c_str());
1142 BOOST_CHECK(deserializedNetwork);
1145 layerName, { inputInfo }, { outputInfo }, descriptor);
1152 const std::string layerName(
"log_softmax");
1156 descriptor.
m_Beta = 1.0f;
1157 descriptor.m_Axis = -1;
1171 BOOST_CHECK(deserializedNetwork);
1179 const std::string layerName(
"maximum");
1197 BOOST_CHECK(deserializedNetwork);
1205 const std::string layerName(
"mean");
1210 descriptor.
m_Axis = { 2 };
1211 descriptor.m_KeepDims =
true;
1225 BOOST_CHECK(deserializedNetwork);
1233 const std::string layerName(
"merge");
1251 BOOST_CHECK(deserializedNetwork);
1260 MergerLayerVerifier(
const std::string& layerName,
1261 const std::vector<armnn::TensorInfo>& inputInfos,
1262 const std::vector<armnn::TensorInfo>& outputInfos,
1268 const std::vector<armnn::ConstTensor>& constants,
1279 throw armnn::Exception(
"MergerLayer should have translated to ConcatLayer");
1284 VerifyNameAndConnections(layer, name);
1287 VerifyDescriptor(layerDescriptor);
1303 const std::string layerName(
"merger");
1307 const std::vector<armnn::TensorShape> shapes({inputInfo.
GetShape(), inputInfo.
GetShape()});
1322 mergerLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0));
1326 mergerLayer->GetOutputSlot(0).SetTensorInfo(outputInfo);
1330 BOOST_CHECK(deserializedNetwork);
1332 MergerLayerVerifier verifier(layerName, {inputInfo, inputInfo}, {outputInfo}, descriptor);
1333 deserializedNetwork->ExecuteStrategy(verifier);
1343 const std::vector<uint8_t> mergerModel =
1345 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x0A, 0x00,
1346 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
1347 0x38, 0x02, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02, 0x00,
1348 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
1349 0xF4, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x0B, 0x04, 0x00, 0x00, 0x00, 0x92, 0xFE, 0xFF, 0xFF, 0x04, 0x00,
1350 0x00, 0x00, 0x9A, 0xFE, 0xFF, 0xFF, 0x04, 0x00, 0x00, 0x00, 0x7E, 0xFE, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00,
1351 0x10, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
1352 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1353 0xF8, 0xFE, 0xFF, 0xFF, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0xFE, 0xFF, 0xFF, 0x00, 0x00,
1354 0x00, 0x1F, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00,
1355 0x68, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00,
1356 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
1357 0x02, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x22, 0xFF, 0xFF, 0xFF, 0x04, 0x00,
1358 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1359 0x00, 0x00, 0x00, 0x00, 0x3E, 0xFF, 0xFF, 0xFF, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
1360 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0xFF, 0xFF, 0xFF,
1361 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x1C, 0x00,
1362 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6D, 0x65, 0x72, 0x67, 0x65, 0x72, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
1363 0x5C, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x34, 0xFF,
1364 0xFF, 0xFF, 0x04, 0x00, 0x00, 0x00, 0x92, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00,
1365 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00,
1366 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x10, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00,
1367 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x00, 0x00,
1368 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0E, 0x00,
1369 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00,
1370 0x06, 0x00, 0x08, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0E, 0x00,
1371 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
1372 0x0E, 0x00, 0x18, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x14, 0x00, 0x0E, 0x00, 0x00, 0x00,
1373 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00,
1374 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
1375 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00,
1376 0x00, 0x00, 0x66, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1377 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00,
1378 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
1379 0x04, 0x00, 0x00, 0x00, 0xF6, 0xFF, 0xFF, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0A, 0x00,
1380 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x00, 0x00,
1381 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00,
1382 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1383 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0A, 0x00, 0x00, 0x00,
1384 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x08, 0x00,
1385 0x07, 0x00, 0x0C, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
1386 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
1387 0x02, 0x00, 0x00, 0x00
1391 BOOST_CHECK(deserializedNetwork);
1396 const std::vector<armnn::TensorShape> shapes({inputInfo.
GetShape(), inputInfo.
GetShape()});
1401 MergerLayerVerifier verifier(
"merger", { inputInfo, inputInfo }, { outputInfo }, descriptor);
1402 deserializedNetwork->ExecuteStrategy(verifier);
1407 const std::string layerName(
"concat");
1411 const std::vector<armnn::TensorShape> shapes({inputInfo.
GetShape(), inputInfo.
GetShape()});
1432 BOOST_CHECK(deserializedNetwork);
1436 MergerLayerVerifier verifier(layerName, {inputInfo, inputInfo}, {outputInfo}, descriptor);
1437 deserializedNetwork->ExecuteStrategy(verifier);
1442 const std::string layerName(
"minimum");
1460 BOOST_CHECK(deserializedNetwork);
1468 const std::string layerName(
"multiplication");
1486 BOOST_CHECK(deserializedNetwork);
1494 const std::string layerName(
"prelu");
1515 BOOST_CHECK(deserializedNetwork);
1517 LayerVerifierBase verifier(layerName, {inputTensorInfo, alphaTensorInfo}, {outputTensorInfo});
1523 const std::string layerName(
"normalization");
1528 desc.m_NormSize = 3;
1545 BOOST_CHECK(deserializedNetwork);
1553 const std::string layerName(
"pad");
1571 BOOST_CHECK(deserializedNetwork);
1588 const std::vector<uint8_t> padModel =
1590 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x0A, 0x00,
1591 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
1592 0x54, 0x01, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
1593 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xD0, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x0B,
1594 0x04, 0x00, 0x00, 0x00, 0x96, 0xFF, 0xFF, 0xFF, 0x04, 0x00, 0x00, 0x00, 0x9E, 0xFF, 0xFF, 0xFF, 0x04, 0x00,
1595 0x00, 0x00, 0x72, 0xFF, 0xFF, 0xFF, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
1596 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
1597 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00,
1598 0x00, 0x00, 0x00, 0x00, 0x24, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x16, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00,
1599 0x0E, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00,
1600 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00,
1601 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1602 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
1603 0x0E, 0x00, 0x18, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x14, 0x00, 0x0E, 0x00, 0x00, 0x00,
1604 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x14, 0x00,
1605 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x70, 0x61, 0x64, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00,
1606 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00,
1607 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x52, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00,
1608 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00,
1609 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00,
1610 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00,
1611 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x04, 0x00, 0x00, 0x00, 0xF6, 0xFF, 0xFF, 0xFF, 0x0C, 0x00, 0x00, 0x00,
1612 0x00, 0x00, 0x06, 0x00, 0x0A, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
1613 0x0E, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x0E, 0x00, 0x00, 0x00,
1614 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
1615 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00,
1616 0x08, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
1617 0x0A, 0x00, 0x10, 0x00, 0x08, 0x00, 0x07, 0x00, 0x0C, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1618 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00,
1619 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00
1623 BOOST_CHECK(deserializedNetwork);
1636 const std::string layerName(
"permute");
1654 BOOST_CHECK(deserializedNetwork);
1657 layerName, {inputTensorInfo}, {outputTensorInfo}, descriptor);
1663 const std::string layerName(
"pooling2d");
1670 desc.m_PadBottom = 0;
1672 desc.m_PadRight = 0;
1676 desc.m_PoolHeight = 2;
1677 desc.m_PoolWidth = 2;
1693 BOOST_CHECK(deserializedNetwork);
1696 layerName, {inputInfo}, {outputInfo}, desc);
1702 const std::string layerName(
"quantize");
1717 BOOST_CHECK(deserializedNetwork);
1725 const std::string layerName(
"rank");
1741 BOOST_CHECK(deserializedNetwork);
1749 const std::string layerName(
"Reduce_Sum");
1769 BOOST_CHECK(deserializedNetwork);
1777 const std::string layerName(
"reshape");
1795 BOOST_CHECK(deserializedNetwork);
1798 layerName, {inputInfo}, {outputInfo}, descriptor);
1804 const std::string layerName(
"resize");
1810 desc.m_TargetHeight = 2;
1812 desc.m_AlignCorners =
true;
1813 desc.m_HalfPixelCenters =
true;
1827 BOOST_CHECK(deserializedNetwork);
1836 ResizeBilinearLayerVerifier(
const std::string& layerName,
1837 const std::vector<armnn::TensorInfo>& inputInfos,
1838 const std::vector<armnn::TensorInfo>& outputInfos,
1841 layerName, inputInfos, outputInfos, descriptor) {}
1845 const std::vector<armnn::ConstTensor>& constants,
1856 VerifyNameAndConnections(layer, name);
1860 BOOST_CHECK(layerDescriptor.
m_TargetWidth == m_Descriptor.m_TargetWidth);
1861 BOOST_CHECK(layerDescriptor.
m_TargetHeight == m_Descriptor.m_TargetHeight);
1862 BOOST_CHECK(layerDescriptor.
m_DataLayout == m_Descriptor.m_DataLayout);
1863 BOOST_CHECK(layerDescriptor.
m_AlignCorners == m_Descriptor.m_AlignCorners);
1869 throw armnn::Exception(
"Unexpected layer type in test model. ResizeBiliniar " 1870 "should have translated to Resize");
1881 const std::string layerName(
"resizeBilinear");
1887 desc.m_TargetHeight = 2u;
1888 desc.m_AlignCorners =
true;
1889 desc.m_HalfPixelCenters =
true;
1899 resizeLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0));
1902 resizeLayer->GetOutputSlot(0).SetTensorInfo(outputInfo);
1905 BOOST_CHECK(deserializedNetwork);
1907 ResizeBilinearLayerVerifier verifier(layerName, {inputInfo}, {outputInfo}, desc);
1908 deserializedNetwork->ExecuteStrategy(verifier);
1918 const std::vector<uint8_t> resizeBilinearModel =
1920 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x0A, 0x00,
1921 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
1922 0x50, 0x01, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
1923 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xD4, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x0B,
1924 0x04, 0x00, 0x00, 0x00, 0xC2, 0xFE, 0xFF, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00,
1925 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x8A, 0xFF, 0xFF, 0xFF, 0x02, 0x00, 0x00, 0x00,
1926 0x10, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
1927 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1928 0x38, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
1929 0x00, 0x1A, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00,
1930 0x34, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x12, 0x00, 0x08, 0x00, 0x0C, 0x00,
1931 0x07, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
1932 0x00, 0x00, 0x0E, 0x00, 0x18, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x14, 0x00, 0x0E, 0x00,
1933 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00,
1934 0x20, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x72, 0x65, 0x73, 0x69, 0x7A, 0x65, 0x42, 0x69, 0x6C, 0x69,
1935 0x6E, 0x65, 0x61, 0x72, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
1936 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00,
1937 0x00, 0x00, 0x52, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1938 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00,
1939 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1940 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
1941 0x00, 0x09, 0x04, 0x00, 0x00, 0x00, 0xF6, 0xFF, 0xFF, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
1942 0x0A, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x14, 0x00,
1943 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
1944 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1945 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0A, 0x00,
1946 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00,
1947 0x08, 0x00, 0x07, 0x00, 0x0C, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00,
1948 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00,
1949 0x00, 0x00, 0x05, 0x00, 0x00, 0x00
1953 DeserializeNetwork(std::string(resizeBilinearModel.begin(), resizeBilinearModel.end()));
1954 BOOST_CHECK(deserializedNetwork);
1961 descriptor.m_TargetHeight = 2u;
1963 ResizeBilinearLayerVerifier verifier(
"resizeBilinear", { inputInfo }, { outputInfo }, descriptor);
1964 deserializedNetwork->ExecuteStrategy(verifier);
1969 const std::string layerName{
"slice"};
1989 BOOST_CHECK(deserializedNetwork);
1997 const std::string layerName(
"softmax");
2001 descriptor.
m_Beta = 1.0f;
2015 BOOST_CHECK(deserializedNetwork);
2023 const std::string layerName(
"spaceToBatchNd");
2029 desc.m_BlockShape = {2, 2};
2030 desc.m_PadList = {{0, 0}, {2, 0}};
2044 BOOST_CHECK(deserializedNetwork);
2047 layerName, {inputInfo}, {outputInfo}, desc);
2053 const std::string layerName(
"spaceToDepth");
2074 BOOST_CHECK(deserializedNetwork);
2077 layerName, {inputInfo}, {outputInfo}, desc);
2083 const unsigned int numViews = 3;
2084 const unsigned int numDimensions = 4;
2085 const unsigned int inputShape[] = {1, 18, 4, 4};
2086 const unsigned int outputShape[] = {1, 6, 4, 4};
2089 unsigned int splitterDimSizes[4] = {
static_cast<unsigned int>(inputShape[0]),
2090 static_cast<unsigned int>(inputShape[1]),
2091 static_cast<unsigned int>(inputShape[2]),
2092 static_cast<unsigned int>(inputShape[3])};
2093 splitterDimSizes[1] /= numViews;
2096 for (
unsigned int g = 0; g < numViews; ++g)
2100 for (
unsigned int dimIdx=0; dimIdx < 4; dimIdx++)
2102 desc.
SetViewSize(g, dimIdx, splitterDimSizes[dimIdx]);
2106 const std::string layerName(
"splitter");
2128 BOOST_CHECK(deserializedNetwork);
2131 layerName, {inputInfo}, {outputInfo, outputInfo, outputInfo}, desc);
2137 const std::string layerName(
"stack");
2159 BOOST_CHECK(deserializedNetwork);
2162 layerName, {inputTensorInfo, inputTensorInfo}, {outputTensorInfo}, descriptor);
2168 const std::string layerName(
"standIn");
2193 BOOST_CHECK(deserializedNetwork);
2196 layerName, { tensorInfo, tensorInfo }, { tensorInfo, tensorInfo }, descriptor);
2202 const std::string layerName(
"stridedSlice");
2206 armnn::StridedSliceDescriptor desc({0, 0, 1, 0}, {1, 1, 1, 1}, {1, 1, 1, 1});
2208 desc.m_ShrinkAxisMask = (1 << 1) | (1 << 2);
2223 BOOST_CHECK(deserializedNetwork);
2226 layerName, {inputInfo}, {outputInfo}, desc);
2232 const std::string layerName(
"subtraction");
2250 BOOST_CHECK(deserializedNetwork);
2261 SwitchLayerVerifier(
const std::string& layerName,
2262 const std::vector<armnn::TensorInfo>& inputInfos,
2263 const std::vector<armnn::TensorInfo>& outputInfos)
2268 const std::vector<armnn::ConstTensor>& constants,
2280 VerifyNameAndConnections(layer, name);
2291 const std::string layerName(
"switch");
2294 std::vector<float> constantData = GenerateRandomData<float>(
info.GetNumElements());
2315 BOOST_CHECK(deserializedNetwork);
2317 SwitchLayerVerifier verifier(layerName, {
info,
info}, {info, info});
2318 deserializedNetwork->ExecuteStrategy(verifier);
2323 const std::string layerName(
"transpose");
2341 BOOST_CHECK(deserializedNetwork);
2344 layerName, {inputTensorInfo}, {outputTensorInfo}, descriptor);
2350 const std::string layerName(
"transposeConvolution2d");
2357 std::vector<float> weightsData = GenerateRandomData<float>(weightsInfo.GetNumElements());
2360 std::vector<float> biasesData = GenerateRandomData<float>(biasesInfo.GetNumElements());
2376 network->AddTransposeConvolution2dLayer(descriptor,
2389 BOOST_CHECK(deserializedNetwork);
2391 const std::vector<armnn::ConstTensor> constants {weights, biases};
2393 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
2402 ConstantLayerVerifier(
const std::string& layerName,
2403 const std::vector<armnn::TensorInfo>& inputInfos,
2404 const std::vector<armnn::TensorInfo>& outputInfos,
2407 , m_LayerInput(layerInput) {}
2411 const std::vector<armnn::ConstTensor>& constants,
2423 VerifyNameAndConnections(layer, name);
2438 const std::string layerName(
"constant");
2441 std::vector<float> constantData = GenerateRandomData<float>(
info.GetNumElements());
2459 BOOST_CHECK(deserializedNetwork);
2461 ConstantLayerVerifier verifier(layerName, {}, {
info}, constTensor);
2462 deserializedNetwork->ExecuteStrategy(verifier);
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
uint32_t m_PadBottom
Padding bottom value in the height dimension.
bool m_BiasEnabled
Enable/disable bias.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
A ViewsDescriptor for the SplitterLayer.
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
float m_ScaleW
Center size encoding scale weight.
bool m_BiasEnabled
Enable/disable bias.
A TransposeConvolution2dDescriptor for the TransposeConvolution2dLayer.
const TensorShape & GetShape() const
uint32_t m_PadBottom
Padding bottom value in the height dimension.
A ReshapeDescriptor for the ReshapeLayer.
armnn::INetworkPtr DeserializeNetwork(const std::string &serializerString)
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
A ComparisonDescriptor for the ComparisonLayer.
float m_ScaleX
Center size encoding scale x.
uint32_t m_TargetWidth
Target width value.
bool m_TransposeWeightMatrix
Enable/disable transpose weight matrix.
A Convolution2dDescriptor for the Convolution2dLayer.
uint32_t m_PadLeft
Padding left value in the width dimension.
bool m_BiasEnabled
Enable/disable bias.
ResizeMethod m_Method
The Interpolation method to use (Bilinear, NearestNeighbor).
float m_Gamma
Gamma, the scale scalar value applied for the normalized tensor. Defaults to 1.0. ...
float m_Beta
Exponentiation value.
The padding fields don't count and are ignored.
float m_Eps
Value to add to the variance. Used to avoid dividing by zero.
ArgMinMaxFunction m_Function
Specify if the function is to find Min or Max.
uint32_t m_DetectionsPerClass
Detections per classes, used in Regular NMS.
armnn::TensorInfo anchorsInfo({ 6, 4 }, armnn::DataType::Float32)
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
A LogicalBinaryDescriptor for the LogicalBinaryLayer.
uint32_t m_PadRight
Padding right value in the width dimension.
void ExecuteStrategy(const armnn::IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0) override
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
Copyright (c) 2021 ARM Limited and Contributors.
void IgnoreUnused(Ts &&...)
uint32_t m_PadBottom
Padding bottom value in the height dimension.
uint32_t m_DilationY
Dilation along y axis.
int32_t m_EndMask
End mask value.
A SpaceToDepthDescriptor for the SpaceToDepthLayer.
uint32_t m_DilationY
Dilation factor value for height dimension.
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
A ResizeDescriptor for the ResizeLayer.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
uint32_t m_MaxClassesPerDetection
Maximum numbers of classes per detection, used in Fast NMS.
Base class for all descriptors.
std::vector< unsigned int > m_Axis
Values for the dimensions to reduce.
A StackDescriptor for the StackLayer.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
uint32_t m_PadTop
Padding top value in the height dimension.
uint32_t m_MaxDetections
Maximum numbers of detections.
A PadDescriptor for the PadLayer.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
float m_NmsIouThreshold
Intersection over union threshold.
#define ARMNN_NO_DEPRECATE_WARN_END
uint32_t m_DilationX
Dilation factor value for width dimension.
uint32_t m_PadTop
Padding top value in the height dimension.
Status SetViewSize(uint32_t view, uint32_t coord, uint32_t value)
Set the size of the views.
void ExecuteStrategy(const armnn::IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0) override
A L2NormalizationDescriptor for the L2NormalizationLayer.
void VerifyNameAndConnections(const armnn::IConnectableLayer *layer, const char *name)
An ArgMinMaxDescriptor for ArgMinMaxLayer.
An OriginsDescriptor for the ConcatLayer.
A ReduceDescriptor for the REDUCE operators.
A FullyConnectedDescriptor for the FullyConnectedLayer.
bool m_BiasEnabled
Enable/disable bias.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
uint32_t m_TargetWidth
Target width value.
A GatherDescriptor for the GatherLayer.
uint32_t m_NumClasses
Number of classes.
bool m_HalfPixelCenters
Half Pixel Centers.
void SerializeArgMinMaxTest(armnn::DataType dataType)
uint32_t m_PadTop
Padding top value in the height dimension.
A StandInDescriptor for the StandIn layer.
LayerVerifierBase(const std::string &layerName, const std::vector< armnn::TensorInfo > &inputInfos, const std::vector< armnn::TensorInfo > &outputInfos)
bool m_UseRegularNms
Use Regular NMS.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
uint32_t m_TargetHeight
Target height value.
A SliceDescriptor for the SliceLayer.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
virtual LayerType GetType() const =0
Returns the armnn::LayerType of this layer.
unsigned int m_BlockSize
Scalar specifying the input block size. It must be >= 1.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
std::vector< uint32_t > m_vAxis
The indices of the dimensions to reduce.
float m_ScaleH
Center size encoding scale height.
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
uint32_t m_DilationX
Dilation along x axis.
BOOST_AUTO_TEST_SUITE_END()
uint32_t m_PadLeft
Padding left value in the width dimension.
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
bool m_AlignCorners
Aligned corners.
uint32_t m_StrideX
Stride value when proceeding through input for the width dimension.
int32_t m_Axis
The axis in params to gather indices from.
A ElementwiseUnaryDescriptor for the ElementwiseUnaryLayer.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
uint32_t m_StrideY
Stride value when proceeding through input for the height dimension.
Base class for all ArmNN exceptions so that users can filter to just those.
void CompareConstTensor(const armnn::ConstTensor &tensor1, const armnn::ConstTensor &tensor2)
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
Get a const input slot handle by slot index.
A MeanDescriptor for the MeanLayer.
uint32_t m_PadRight
Padding right value in the width dimension.
A TransposeDescriptor for the TransposeLayer.
A StridedSliceDescriptor for the StridedSliceLayer.
virtual const IOutputSlot & GetOutputSlot(unsigned int index) const =0
Get the const output slot handle by slot index.
float m_ScaleY
Center size encoding scale y.
OriginsDescriptor CreateDescriptorForConcatenation(TensorShapeIt first, TensorShapeIt last, unsigned int concatenationDimension)
Convenience template to create an OriginsDescriptor to use when creating a ConcatLayer for performing...
float m_NmsScoreThreshold
NMS score threshold.
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
virtual int Connect(IInputSlot &destination)=0
A Pooling2dDescriptor for the Pooling2dLayer.
std::string SerializeNetwork(const armnn::INetwork &network)
A NormalizationDescriptor for the NormalizationLayer.
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
An InstanceNormalizationDescriptor for InstanceNormalizationLayer.
A ResizeBilinearDescriptor for the ResizeBilinearLayer.
static INetworkPtr Create(NetworkOptions networkOptions={})
A SoftmaxDescriptor for the SoftmaxLayer.
Status SetViewOriginCoord(uint32_t view, uint32_t coord, uint32_t value)
Set the view origin coordinates.
BOOST_AUTO_TEST_CASE(SerializeAbs)
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A FillDescriptor for the FillLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
uint32_t m_PadLeft
Padding left value in the width dimension.
void ExecuteStrategy(const armnn::IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0) override
A PermuteDescriptor for the PermuteLayer.
uint32_t m_PadRight
Padding right value in the width dimension.
bool m_ConstantWeights
Enable/disable constant weights and biases.
std::vector< float > anchors({ 0.5f, 0.5f, 1.0f, 1.0f, 0.5f, 0.5f, 1.0f, 1.0f, 0.5f, 0.5f, 1.0f, 1.0f, 0.5f, 10.5f, 1.0f, 1.0f, 0.5f, 10.5f, 1.0f, 1.0f, 0.5f, 100.5f, 1.0f, 1.0f })