2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include <boost/test/unit_test.hpp>
7 #include "ParserFlatbuffersSerializeFixture.hpp"
8 #include "../Deserializer.hpp"
13 BOOST_AUTO_TEST_SUITE(DeserializeParser)
15 struct ConstantAddFixture : public ParserFlatbuffersSerializeFixture
17 explicit ConstantAddFixture(const std::string & shape,
18 const std::string & constTensorDatatype,
19 const std::string & constData,
20 const std::string & dataType)
28 layer_type: "InputLayer",
34 layerName: "InputLayer1",
38 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
43 dimensions: )" + shape + R"(,
44 dataType: )" + dataType + R"(
50 layer_type: "ConstantLayer",
54 layerName: "ConstantLayer",
55 layerType: "Constant",
59 dimensions: )" + shape + R"(,
60 dataType: )" + dataType + R"(,
65 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
70 dimensions: )" + shape + R"(,
71 dataType: )" + dataType + R"(
73 data_type: )" + constTensorDatatype + R"(,
75 data: )" + constData + R"(,
80 layer_type: "AdditionLayer",
84 layerName: "AdditionLayer",
85 layerType: "Addition",
89 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
93 connection: {sourceLayerIndex:1, outputSlotIndex:0 },
99 dimensions: )" + shape + R"(,
100 dataType: )" + dataType + R"(
106 layer_type: "OutputLayer",
112 layerName: "OutputLayer",
116 connection: {sourceLayerIndex:2, outputSlotIndex:0 },
121 dimensions: )" + shape + R"(,
122 dataType: )" + dataType + R"(
129 SetupSingleInputSingleOutput("InputLayer1", "OutputLayer");
133 struct SimpleConstantAddFixture : ConstantAddFixture
135 SimpleConstantAddFixture()
136 : ConstantAddFixture("[ 2, 3 ]", // shape
137 "ByteData", // constDataType
138 "[ 1, 2, 3, 4, 5, 6 ]", // constData
139 "QuantisedAsymm8") // datatype
144 BOOST_FIXTURE_TEST_CASE(SimpleConstantAddQuantisedAsymm8, SimpleConstantAddFixture)
146 RunTest<2, armnn::DataType::QAsymmU8>(
148 { 1, 2, 3, 4, 5, 6 },
149 { 2, 4, 6, 8, 10, 12 });
152 BOOST_AUTO_TEST_SUITE_END()