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(Deserializer)
15 struct Convolution2dFixture : public ParserFlatbuffersSerializeFixture
17 explicit Convolution2dFixture(const std::string & inputShape1,
18 const std::string & outputShape,
19 const std::string & weightsShape,
20 const std::string & dataType)
27 layer_type: "InputLayer",
33 layerName: "InputLayer",
37 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
42 dimensions: )" + inputShape1 + R"(,
43 dataType: )" + dataType + R"(,
44 quantizationScale: 0.5,
53 layer_type: "Convolution2dLayer",
57 layerName: "Convolution2dLayer",
58 layerType: "Convolution2d",
61 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
66 dimensions: )" + outputShape + R"(,
67 dataType: )" + dataType + R"(
83 dimensions: )" + weightsShape + R"(,
84 dataType: )" + dataType + R"(
89 1082130432, 1084227584, 1086324736,
91 1077936128, 1073741824, 1065353216
98 layer_type: "OutputLayer",
104 layerName: "OutputLayer",
108 connection: {sourceLayerIndex:1, outputSlotIndex:0 },
113 dimensions: )" + outputShape + R"(,
114 dataType: )" + dataType + R"(
126 struct SimpleConvolution2dFixture : Convolution2dFixture
128 SimpleConvolution2dFixture() : Convolution2dFixture("[ 1, 5, 5, 1 ]",
134 BOOST_FIXTURE_TEST_CASE(Convolution2dFloat32, SimpleConvolution2dFixture)
136 RunTest<4, armnn::DataType::Float32>(
138 {{"InputLayer", {1, 5, 2, 3, 5, 8, 7, 3, 6, 3, 3, 3, 9, 1, 9, 4, 1, 8, 1, 3, 6, 8, 1, 9, 2}}},
139 {{"OutputLayer", {23, 33, 24, 91, 99, 48, 26, 50, 19}}});
142 BOOST_AUTO_TEST_SUITE_END()