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);
112 const std::string layerName(
"batchNormalization");
122 descriptor.
m_Eps = 0.0010000000475f;
125 std::vector<float> meanData({5.0});
126 std::vector<float> varianceData({2.0});
127 std::vector<float> betaData({1.0});
128 std::vector<float> gammaData({0.0});
130 std::vector<armnn::ConstTensor> constants;
139 network->AddBatchNormalizationLayer(descriptor,
154 BOOST_CHECK(deserializedNetwork);
157 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
163 const std::string layerName(
"spaceToBatchNd");
169 desc.m_BlockShape = {2, 2};
170 desc.m_Crops = {{0, 0}, {0, 0}};
184 BOOST_CHECK(deserializedNetwork);
195 const std::string layerName(
"comparison");
219 BOOST_CHECK(deserializedNetwork);
222 { inputInfo, inputInfo },
233 ConstantLayerVerifier(
const std::string& layerName,
234 const std::vector<armnn::TensorInfo>& inputInfos,
235 const std::vector<armnn::TensorInfo>& outputInfos,
236 const std::vector<armnn::ConstTensor>& constants)
238 , m_Constants(constants) {}
242 const std::vector<armnn::ConstTensor>& constants,
257 for (std::size_t i = 0; i < constants.size(); i++)
266 const std::vector<armnn::ConstTensor> m_Constants;
269 const std::string layerName(
"constant");
272 std::vector<float> constantData = GenerateRandomData<float>(info.GetNumElements());
290 BOOST_CHECK(deserializedNetwork);
292 ConstantLayerVerifier verifier(layerName, {}, {info}, {constTensor});
293 deserializedNetwork->ExecuteStrategy(verifier);
298 const std::string layerName(
"convolution2d");
305 std::vector<float> weightsData = GenerateRandomData<float>(weightsInfo.GetNumElements());
308 std::vector<float> biasesData = GenerateRandomData<float>(biasesInfo.GetNumElements());
326 network->AddConvolution2dLayer(descriptor,
339 BOOST_CHECK(deserializedNetwork);
341 const std::vector<armnn::ConstTensor>& constants {weights, biases};
343 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
349 using namespace armnn;
351 const std::string layerName(
"convolution2dWithPerAxis");
352 const TensorInfo inputInfo ({ 1, 3, 1, 2 }, DataType::QAsymmU8, 0.55f, 128);
353 const TensorInfo outputInfo({ 1, 3, 1, 3 }, DataType::QAsymmU8, 0.75f, 128);
355 const std::vector<float> quantScales{ 0.75f, 0.65f, 0.85f };
356 constexpr
unsigned int quantDimension = 0;
358 const TensorInfo kernelInfo({ 3, 1, 1, 2 }, DataType::QSymmS8, quantScales, quantDimension);
360 const std::vector<float> biasQuantScales{ 0.25f, 0.50f, 0.75f };
361 const TensorInfo biasInfo({ 3 }, DataType::Signed32, biasQuantScales, quantDimension);
363 std::vector<int8_t> kernelData = GenerateRandomData<int8_t>(kernelInfo.GetNumElements());
365 std::vector<int32_t> biasData = GenerateRandomData<int32_t>(biasInfo.GetNumElements());
381 network->AddConvolution2dLayer(descriptor,
394 BOOST_CHECK(deserializedNetwork);
396 const std::vector<armnn::ConstTensor>& constants {weights, biases};
398 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
404 const std::string layerName(
"depthToSpace");
425 BOOST_CHECK(deserializedNetwork);
433 const std::string layerName(
"depwiseConvolution2d");
440 std::vector<float> weightsData = GenerateRandomData<float>(weightsInfo.GetNumElements());
443 std::vector<int32_t> biasesData = GenerateRandomData<int32_t>(biasesInfo.GetNumElements());
461 network->AddDepthwiseConvolution2dLayer(descriptor,
474 BOOST_CHECK(deserializedNetwork);
476 const std::vector<armnn::ConstTensor>& constants {weights, biases};
478 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
484 using namespace armnn;
486 const std::string layerName(
"depwiseConvolution2dWithPerAxis");
487 const TensorInfo inputInfo ({ 1, 3, 3, 2 }, DataType::QAsymmU8, 0.55f, 128);
488 const TensorInfo outputInfo({ 1, 2, 2, 4 }, DataType::QAsymmU8, 0.75f, 128);
490 const std::vector<float> quantScales{ 0.75f, 0.80f, 0.90f, 0.95f };
491 const unsigned int quantDimension = 0;
492 TensorInfo kernelInfo({ 2, 2, 2, 2 }, DataType::QSymmS8, quantScales, quantDimension);
494 const std::vector<float> biasQuantScales{ 0.25f, 0.35f, 0.45f, 0.55f };
495 constexpr
unsigned int biasQuantDimension = 0;
496 TensorInfo biasInfo({ 4 }, DataType::Signed32, biasQuantScales, biasQuantDimension);
498 std::vector<int8_t> kernelData = GenerateRandomData<int8_t>(kernelInfo.GetNumElements());
500 std::vector<int32_t> biasData = GenerateRandomData<int32_t>(biasInfo.GetNumElements());
518 network->AddDepthwiseConvolution2dLayer(descriptor,
531 BOOST_CHECK(deserializedNetwork);
533 const std::vector<armnn::ConstTensor>& constants {weights, biases};
535 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
541 const std::string layerName(
"dequantize");
557 BOOST_CHECK(deserializedNetwork);
565 const std::string layerName(
"detectionPostProcess");
567 const std::vector<armnn::TensorInfo> inputInfos({
572 const std::vector<armnn::TensorInfo> outputInfos({
593 const std::vector<float> anchorsData({
594 0.5f, 0.5f, 1.0f, 1.0f,
595 0.5f, 0.5f, 1.0f, 1.0f,
596 0.5f, 0.5f, 1.0f, 1.0f,
597 0.5f, 10.5f, 1.0f, 1.0f,
598 0.5f, 10.5f, 1.0f, 1.0f,
599 0.5f, 100.5f, 1.0f, 1.0f
605 network->AddDetectionPostProcessLayer(descriptor, anchors, layerName.c_str());
607 for (
unsigned int i = 0; i < 2; i++)
614 for (
unsigned int i = 0; i < 4; i++)
622 BOOST_CHECK(deserializedNetwork);
624 const std::vector<armnn::ConstTensor>& constants {anchors};
626 layerName, inputInfos, outputInfos, descriptor, constants);
627 deserializedNetwork->ExecuteStrategy(verifier);
632 const std::string layerName(
"division");
650 BOOST_CHECK(deserializedNetwork);
658 const std::string layerName(
"EqualLayer");
675 equalLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0));
676 equalLayer->GetOutputSlot(0).SetTensorInfo(outputTensorInfo);
679 BOOST_CHECK(deserializedNetwork);
681 LayerVerifierBase verifier(layerName, {inputTensorInfo1, inputTensorInfo2}, {outputTensorInfo});
687 const std::string layerName(
"fill");
705 BOOST_CHECK(deserializedNetwork);
714 const std::string layerName(
"floor");
729 BOOST_CHECK(deserializedNetwork);
737 const std::string layerName(
"fullyConnected");
743 std::vector<float> weightsData = GenerateRandomData<float>(weightsInfo.GetNumElements());
744 std::vector<float> biasesData = GenerateRandomData<float>(biasesInfo.GetNumElements());
755 network->AddFullyConnectedLayer(descriptor,
768 BOOST_CHECK(deserializedNetwork);
770 const std::vector<armnn::ConstTensor> constants {weights, biases};
772 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
782 GatherLayerVerifier(
const std::string& layerName,
783 const std::vector<armnn::TensorInfo>& inputInfos,
784 const std::vector<armnn::TensorInfo>& outputInfos,
790 const std::vector<armnn::ConstTensor>& constants,
802 VerifyNameAndConnections(layer, name);
804 BOOST_CHECK(layerDescriptor.
m_Axis == m_Descriptor.m_Axis);
810 const std::string layerName(
"gather");
817 paramsInfo.SetQuantizationScale(1.0f);
818 paramsInfo.SetQuantizationOffset(0);
819 outputInfo.SetQuantizationScale(1.0f);
820 outputInfo.SetQuantizationOffset(0);
822 const std::vector<int32_t>& indicesData = {7, 6, 5};
840 BOOST_CHECK(deserializedNetwork);
842 GatherLayerVerifier verifier(layerName, {paramsInfo, indicesInfo}, {outputInfo}, descriptor);
843 deserializedNetwork->ExecuteStrategy(verifier);
852 const std::string layerName(
"greater");
869 equalLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0));
873 equalLayer->GetOutputSlot(0).SetTensorInfo(outputInfo);
876 BOOST_CHECK(deserializedNetwork);
885 const std::string layerName(
"instanceNormalization");
890 descriptor.m_Beta = 0.1f;
891 descriptor.m_Eps = 0.0001f;
897 network->AddInstanceNormalizationLayer(descriptor, layerName.c_str());
907 BOOST_CHECK(deserializedNetwork);
910 layerName, {
info}, {
info}, descriptor);
916 const std::string l2NormLayerName(
"l2Normalization");
921 desc.m_Eps = 0.0001f;
935 BOOST_CHECK(deserializedNetwork);
938 l2NormLayerName, {
info}, {
info}, desc);
949 const std::vector<uint8_t> l2NormalizationModel =
951 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x0A, 0x00,
952 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
953 0x3C, 0x01, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
954 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xE8, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x0B,
955 0x04, 0x00, 0x00, 0x00, 0xD6, 0xFE, 0xFF, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00,
956 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x9E, 0xFF, 0xFF, 0xFF, 0x02, 0x00, 0x00, 0x00,
957 0x10, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
958 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
959 0x4C, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
960 0x00, 0x20, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00,
961 0x20, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x06, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
962 0x0E, 0x00, 0x18, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x14, 0x00, 0x0E, 0x00, 0x00, 0x00,
963 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x20, 0x00,
964 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x6C, 0x32, 0x4E, 0x6F, 0x72, 0x6D, 0x61, 0x6C, 0x69, 0x7A, 0x61, 0x74,
965 0x69, 0x6F, 0x6E, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00,
966 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
967 0x52, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
968 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
969 0x08, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
970 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
971 0x04, 0x00, 0x00, 0x00, 0xF6, 0xFF, 0xFF, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0A, 0x00,
972 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x00, 0x00,
973 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00,
974 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
975 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0A, 0x00, 0x00, 0x00,
976 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x08, 0x00,
977 0x07, 0x00, 0x0C, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
978 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
979 0x05, 0x00, 0x00, 0x00, 0x00
983 DeserializeNetwork(std::string(l2NormalizationModel.begin(), l2NormalizationModel.end()));
984 BOOST_CHECK(deserializedNetwork);
986 const std::string layerName(
"l2Normalization");
995 layerName, {inputInfo}, {inputInfo}, desc);
1001 const std::string layerName(
"logicalBinaryAnd");
1013 armnn::IConnectableLayer*
const logicalBinaryLayer = network->AddLogicalBinaryLayer(descriptor, layerName.c_str());
1025 BOOST_CHECK(deserializedNetwork);
1028 layerName, { inputInfo, inputInfo }, { outputInfo }, descriptor);
1034 const std::string layerName(
"elementwiseUnaryLogicalNot");
1046 network->AddElementwiseUnaryLayer(descriptor, layerName.c_str());
1057 BOOST_CHECK(deserializedNetwork);
1060 layerName, { inputInfo }, { outputInfo }, descriptor);
1067 const std::string layerName(
"log_softmax");
1071 descriptor.
m_Beta = 1.0f;
1072 descriptor.m_Axis = -1;
1086 BOOST_CHECK(deserializedNetwork);
1094 const std::string layerName(
"maximum");
1112 BOOST_CHECK(deserializedNetwork);
1120 const std::string layerName(
"mean");
1125 descriptor.
m_Axis = { 2 };
1126 descriptor.m_KeepDims =
true;
1140 BOOST_CHECK(deserializedNetwork);
1148 const std::string layerName(
"merge");
1166 BOOST_CHECK(deserializedNetwork);
1175 MergerLayerVerifier(
const std::string& layerName,
1176 const std::vector<armnn::TensorInfo>& inputInfos,
1177 const std::vector<armnn::TensorInfo>& outputInfos,
1183 const std::vector<armnn::ConstTensor>& constants,
1194 throw armnn::Exception(
"MergerLayer should have translated to ConcatLayer");
1199 VerifyNameAndConnections(layer, name);
1202 VerifyDescriptor(layerDescriptor);
1218 const std::string layerName(
"merger");
1222 const std::vector<armnn::TensorShape> shapes({inputInfo.
GetShape(), inputInfo.
GetShape()});
1237 mergerLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0));
1241 mergerLayer->GetOutputSlot(0).SetTensorInfo(outputInfo);
1245 BOOST_CHECK(deserializedNetwork);
1247 MergerLayerVerifier verifier(layerName, {inputInfo, inputInfo}, {outputInfo}, descriptor);
1248 deserializedNetwork->ExecuteStrategy(verifier);
1258 const std::vector<uint8_t> mergerModel =
1260 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x0A, 0x00,
1261 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
1262 0x38, 0x02, 0x00, 0x00, 0x8C, 0x01, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x02, 0x00,
1263 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
1264 0xF4, 0xFD, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x0B, 0x04, 0x00, 0x00, 0x00, 0x92, 0xFE, 0xFF, 0xFF, 0x04, 0x00,
1265 0x00, 0x00, 0x9A, 0xFE, 0xFF, 0xFF, 0x04, 0x00, 0x00, 0x00, 0x7E, 0xFE, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00,
1266 0x10, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
1267 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1268 0xF8, 0xFE, 0xFF, 0xFF, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0xFE, 0xFF, 0xFF, 0x00, 0x00,
1269 0x00, 0x1F, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00,
1270 0x68, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00,
1271 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
1272 0x02, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x22, 0xFF, 0xFF, 0xFF, 0x04, 0x00,
1273 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1274 0x00, 0x00, 0x00, 0x00, 0x3E, 0xFF, 0xFF, 0xFF, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
1275 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0xFF, 0xFF, 0xFF,
1276 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x1C, 0x00,
1277 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6D, 0x65, 0x72, 0x67, 0x65, 0x72, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
1278 0x5C, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x34, 0xFF,
1279 0xFF, 0xFF, 0x04, 0x00, 0x00, 0x00, 0x92, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00,
1280 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00,
1281 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x10, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00,
1282 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x00, 0x00,
1283 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0E, 0x00,
1284 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00,
1285 0x06, 0x00, 0x08, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0E, 0x00,
1286 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
1287 0x0E, 0x00, 0x18, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x14, 0x00, 0x0E, 0x00, 0x00, 0x00,
1288 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00,
1289 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
1290 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00,
1291 0x00, 0x00, 0x66, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1292 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00,
1293 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
1294 0x04, 0x00, 0x00, 0x00, 0xF6, 0xFF, 0xFF, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0A, 0x00,
1295 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x14, 0x00, 0x00, 0x00,
1296 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00,
1297 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1298 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0A, 0x00, 0x00, 0x00,
1299 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x08, 0x00,
1300 0x07, 0x00, 0x0C, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
1301 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
1302 0x02, 0x00, 0x00, 0x00
1306 BOOST_CHECK(deserializedNetwork);
1311 const std::vector<armnn::TensorShape> shapes({inputInfo.
GetShape(), inputInfo.
GetShape()});
1316 MergerLayerVerifier verifier(
"merger", { inputInfo, inputInfo }, { outputInfo }, descriptor);
1317 deserializedNetwork->ExecuteStrategy(verifier);
1322 const std::string layerName(
"concat");
1326 const std::vector<armnn::TensorShape> shapes({inputInfo.
GetShape(), inputInfo.
GetShape()});
1347 BOOST_CHECK(deserializedNetwork);
1351 MergerLayerVerifier verifier(layerName, {inputInfo, inputInfo}, {outputInfo}, descriptor);
1352 deserializedNetwork->ExecuteStrategy(verifier);
1357 const std::string layerName(
"minimum");
1375 BOOST_CHECK(deserializedNetwork);
1383 const std::string layerName(
"multiplication");
1401 BOOST_CHECK(deserializedNetwork);
1409 const std::string layerName(
"prelu");
1430 BOOST_CHECK(deserializedNetwork);
1432 LayerVerifierBase verifier(layerName, {inputTensorInfo, alphaTensorInfo}, {outputTensorInfo});
1438 const std::string layerName(
"normalization");
1443 desc.m_NormSize = 3;
1460 BOOST_CHECK(deserializedNetwork);
1468 const std::string layerName(
"pad");
1486 BOOST_CHECK(deserializedNetwork);
1503 const std::vector<uint8_t> padModel =
1505 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x0A, 0x00,
1506 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
1507 0x54, 0x01, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
1508 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xD0, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x0B,
1509 0x04, 0x00, 0x00, 0x00, 0x96, 0xFF, 0xFF, 0xFF, 0x04, 0x00, 0x00, 0x00, 0x9E, 0xFF, 0xFF, 0xFF, 0x04, 0x00,
1510 0x00, 0x00, 0x72, 0xFF, 0xFF, 0xFF, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
1511 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
1512 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00,
1513 0x00, 0x00, 0x00, 0x00, 0x24, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x16, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00,
1514 0x0E, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00,
1515 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00,
1516 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1517 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
1518 0x0E, 0x00, 0x18, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x14, 0x00, 0x0E, 0x00, 0x00, 0x00,
1519 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x14, 0x00,
1520 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x70, 0x61, 0x64, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00,
1521 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00,
1522 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x52, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00,
1523 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00,
1524 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00,
1525 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00,
1526 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x04, 0x00, 0x00, 0x00, 0xF6, 0xFF, 0xFF, 0xFF, 0x0C, 0x00, 0x00, 0x00,
1527 0x00, 0x00, 0x06, 0x00, 0x0A, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
1528 0x0E, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x0E, 0x00, 0x00, 0x00,
1529 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
1530 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00,
1531 0x08, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
1532 0x0A, 0x00, 0x10, 0x00, 0x08, 0x00, 0x07, 0x00, 0x0C, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
1533 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00,
1534 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00
1538 BOOST_CHECK(deserializedNetwork);
1551 const std::string layerName(
"permute");
1569 BOOST_CHECK(deserializedNetwork);
1572 layerName, {inputTensorInfo}, {outputTensorInfo}, descriptor);
1578 const std::string layerName(
"pooling2d");
1585 desc.m_PadBottom = 0;
1587 desc.m_PadRight = 0;
1591 desc.m_PoolHeight = 2;
1592 desc.m_PoolWidth = 2;
1608 BOOST_CHECK(deserializedNetwork);
1611 layerName, {inputInfo}, {outputInfo}, desc);
1617 const std::string layerName(
"quantize");
1632 BOOST_CHECK(deserializedNetwork);
1640 const std::string layerName(
"rank");
1656 BOOST_CHECK(deserializedNetwork);
1664 const std::string layerName(
"Reduce_Sum");
1684 BOOST_CHECK(deserializedNetwork);
1692 const std::string layerName(
"reshape");
1710 BOOST_CHECK(deserializedNetwork);
1713 layerName, {inputInfo}, {outputInfo}, descriptor);
1719 const std::string layerName(
"resize");
1725 desc.m_TargetHeight = 2;
1727 desc.m_AlignCorners =
true;
1728 desc.m_HalfPixelCenters =
true;
1742 BOOST_CHECK(deserializedNetwork);
1751 ResizeBilinearLayerVerifier(
const std::string& layerName,
1752 const std::vector<armnn::TensorInfo>& inputInfos,
1753 const std::vector<armnn::TensorInfo>& outputInfos,
1756 layerName, inputInfos, outputInfos, descriptor) {}
1760 const std::vector<armnn::ConstTensor>& constants,
1771 VerifyNameAndConnections(layer, name);
1775 BOOST_CHECK(layerDescriptor.
m_TargetWidth == m_Descriptor.m_TargetWidth);
1776 BOOST_CHECK(layerDescriptor.
m_TargetHeight == m_Descriptor.m_TargetHeight);
1777 BOOST_CHECK(layerDescriptor.
m_DataLayout == m_Descriptor.m_DataLayout);
1778 BOOST_CHECK(layerDescriptor.
m_AlignCorners == m_Descriptor.m_AlignCorners);
1784 throw armnn::Exception(
"Unexpected layer type in test model. ResizeBiliniar " 1785 "should have translated to Resize");
1796 const std::string layerName(
"resizeBilinear");
1802 desc.m_TargetHeight = 2u;
1803 desc.m_AlignCorners =
true;
1804 desc.m_HalfPixelCenters =
true;
1814 resizeLayer->GetOutputSlot(0).Connect(outputLayer->GetInputSlot(0));
1817 resizeLayer->GetOutputSlot(0).SetTensorInfo(outputInfo);
1820 BOOST_CHECK(deserializedNetwork);
1822 ResizeBilinearLayerVerifier verifier(layerName, {inputInfo}, {outputInfo}, desc);
1823 deserializedNetwork->ExecuteStrategy(verifier);
1833 const std::vector<uint8_t> resizeBilinearModel =
1835 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x0A, 0x00,
1836 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
1837 0x50, 0x01, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
1838 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xD4, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x0B,
1839 0x04, 0x00, 0x00, 0x00, 0xC2, 0xFE, 0xFF, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00,
1840 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x8A, 0xFF, 0xFF, 0xFF, 0x02, 0x00, 0x00, 0x00,
1841 0x10, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
1842 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1843 0x38, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
1844 0x00, 0x1A, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0E, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00,
1845 0x34, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x12, 0x00, 0x08, 0x00, 0x0C, 0x00,
1846 0x07, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
1847 0x00, 0x00, 0x0E, 0x00, 0x18, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x14, 0x00, 0x0E, 0x00,
1848 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00,
1849 0x20, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x72, 0x65, 0x73, 0x69, 0x7A, 0x65, 0x42, 0x69, 0x6C, 0x69,
1850 0x6E, 0x65, 0x61, 0x72, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
1851 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00,
1852 0x00, 0x00, 0x52, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1853 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00,
1854 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1855 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x07, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
1856 0x00, 0x09, 0x04, 0x00, 0x00, 0x00, 0xF6, 0xFF, 0xFF, 0xFF, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
1857 0x0A, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x14, 0x00,
1858 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
1859 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1860 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0A, 0x00,
1861 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x10, 0x00,
1862 0x08, 0x00, 0x07, 0x00, 0x0C, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00,
1863 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00,
1864 0x00, 0x00, 0x05, 0x00, 0x00, 0x00
1868 DeserializeNetwork(std::string(resizeBilinearModel.begin(), resizeBilinearModel.end()));
1869 BOOST_CHECK(deserializedNetwork);
1876 descriptor.m_TargetHeight = 2u;
1878 ResizeBilinearLayerVerifier verifier(
"resizeBilinear", { inputInfo }, { outputInfo }, descriptor);
1879 deserializedNetwork->ExecuteStrategy(verifier);
1884 const std::string layerName{
"slice"};
1904 BOOST_CHECK(deserializedNetwork);
1912 const std::string layerName(
"softmax");
1916 descriptor.
m_Beta = 1.0f;
1930 BOOST_CHECK(deserializedNetwork);
1938 const std::string layerName(
"spaceToBatchNd");
1944 desc.m_BlockShape = {2, 2};
1945 desc.m_PadList = {{0, 0}, {2, 0}};
1959 BOOST_CHECK(deserializedNetwork);
1962 layerName, {inputInfo}, {outputInfo}, desc);
1968 const std::string layerName(
"spaceToDepth");
1989 BOOST_CHECK(deserializedNetwork);
1992 layerName, {inputInfo}, {outputInfo}, desc);
1998 const unsigned int numViews = 3;
1999 const unsigned int numDimensions = 4;
2000 const unsigned int inputShape[] = {1, 18, 4, 4};
2001 const unsigned int outputShape[] = {1, 6, 4, 4};
2004 unsigned int splitterDimSizes[4] = {
static_cast<unsigned int>(inputShape[0]),
2005 static_cast<unsigned int>(inputShape[1]),
2006 static_cast<unsigned int>(inputShape[2]),
2007 static_cast<unsigned int>(inputShape[3])};
2008 splitterDimSizes[1] /= numViews;
2011 for (
unsigned int g = 0; g < numViews; ++g)
2015 for (
unsigned int dimIdx=0; dimIdx < 4; dimIdx++)
2017 desc.
SetViewSize(g, dimIdx, splitterDimSizes[dimIdx]);
2021 const std::string layerName(
"splitter");
2043 BOOST_CHECK(deserializedNetwork);
2046 layerName, {inputInfo}, {outputInfo, outputInfo, outputInfo}, desc);
2052 const std::string layerName(
"stack");
2074 BOOST_CHECK(deserializedNetwork);
2077 layerName, {inputTensorInfo, inputTensorInfo}, {outputTensorInfo}, descriptor);
2083 const std::string layerName(
"standIn");
2108 BOOST_CHECK(deserializedNetwork);
2111 layerName, { tensorInfo, tensorInfo }, { tensorInfo, tensorInfo }, descriptor);
2117 const std::string layerName(
"stridedSlice");
2121 armnn::StridedSliceDescriptor desc({0, 0, 1, 0}, {1, 1, 1, 1}, {1, 1, 1, 1});
2123 desc.m_ShrinkAxisMask = (1 << 1) | (1 << 2);
2138 BOOST_CHECK(deserializedNetwork);
2141 layerName, {inputInfo}, {outputInfo}, desc);
2147 const std::string layerName(
"subtraction");
2165 BOOST_CHECK(deserializedNetwork);
2176 SwitchLayerVerifier(
const std::string& layerName,
2177 const std::vector<armnn::TensorInfo>& inputInfos,
2178 const std::vector<armnn::TensorInfo>& outputInfos)
2183 const std::vector<armnn::ConstTensor>& constants,
2195 VerifyNameAndConnections(layer, name);
2206 const std::string layerName(
"switch");
2209 std::vector<float> constantData = GenerateRandomData<float>(
info.GetNumElements());
2230 BOOST_CHECK(deserializedNetwork);
2232 SwitchLayerVerifier verifier(layerName, {
info,
info}, {info, info});
2233 deserializedNetwork->ExecuteStrategy(verifier);
2238 const std::string layerName(
"transpose");
2256 BOOST_CHECK(deserializedNetwork);
2259 layerName, {inputTensorInfo}, {outputTensorInfo}, descriptor);
2265 const std::string layerName(
"transposeConvolution2d");
2272 std::vector<float> weightsData = GenerateRandomData<float>(weightsInfo.GetNumElements());
2275 std::vector<float> biasesData = GenerateRandomData<float>(biasesInfo.GetNumElements());
2291 network->AddTransposeConvolution2dLayer(descriptor,
2304 BOOST_CHECK(deserializedNetwork);
2306 const std::vector<armnn::ConstTensor> constants {weights, biases};
2308 layerName, {inputInfo}, {outputInfo}, descriptor, constants);
2317 ConstantLayerVerifier(
const std::string& layerName,
2318 const std::vector<armnn::TensorInfo>& inputInfos,
2319 const std::vector<armnn::TensorInfo>& outputInfos,
2322 , m_LayerInput(layerInput) {}
2326 const std::vector<armnn::ConstTensor>& constants,
2338 VerifyNameAndConnections(layer, name);
2353 const std::string layerName(
"constant");
2356 std::vector<float> constantData = GenerateRandomData<float>(
info.GetNumElements());
2374 BOOST_CHECK(deserializedNetwork);
2376 ConstantLayerVerifier verifier(layerName, {}, {
info}, constTensor);
2377 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.
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.
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.
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 })