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 <armnnDeserializer/IDeserializer.hpp>
12 BOOST_AUTO_TEST_SUITE(Deserializer)
14 struct Convolution2dFixture : public ParserFlatbuffersSerializeFixture
16 explicit Convolution2dFixture(const std::string & inputShape1,
17 const std::string & outputShape,
18 const std::string & weightsShape,
19 const std::string & dataType)
26 layer_type: "InputLayer",
32 layerName: "InputLayer",
36 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
41 dimensions: )" + inputShape1 + R"(,
42 dataType: )" + dataType + R"(,
43 quantizationScale: 0.5,
52 layer_type: "Convolution2dLayer",
56 layerName: "Convolution2dLayer",
57 layerType: "Convolution2d",
60 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
65 dimensions: )" + outputShape + R"(,
66 dataType: )" + dataType + R"(
82 dimensions: )" + weightsShape + R"(,
83 dataType: )" + dataType + R"(
88 1082130432, 1084227584, 1086324736,
90 1077936128, 1073741824, 1065353216
97 layer_type: "OutputLayer",
103 layerName: "OutputLayer",
107 connection: {sourceLayerIndex:1, outputSlotIndex:0 },
112 dimensions: )" + outputShape + R"(,
113 dataType: )" + dataType + R"(
125 struct SimpleConvolution2dFixture : Convolution2dFixture
127 SimpleConvolution2dFixture() : Convolution2dFixture("[ 1, 5, 5, 1 ]",
133 BOOST_FIXTURE_TEST_CASE(Convolution2dFloat32, SimpleConvolution2dFixture)
135 RunTest<4, armnn::DataType::Float32>(
137 {{"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}}},
138 {{"OutputLayer", {23, 33, 24, 91, 99, 48, 26, 50, 19}}});
141 BOOST_AUTO_TEST_SUITE_END()