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 FullyConnectedFixture : public ParserFlatbuffersSerializeFixture
17 explicit FullyConnectedFixture(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: 1.0,
53 layer_type: "FullyConnectedLayer",
57 layerName: "FullyConnectedLayer",
58 layerType: "FullyConnected",
61 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
66 dimensions: )" + outputShape + R"(,
67 dataType: )" + dataType + R"(,
68 quantizationScale: 2.0,
75 transposeWeightsMatrix: true
79 dimensions: )" + weightsShape + R"(,
80 dataType: )" + dataType + R"(,
81 quantizationScale: 1.0,
94 layer_type: "OutputLayer",
100 layerName: "OutputLayer",
104 connection: {sourceLayerIndex:1, outputSlotIndex:0 },
109 dimensions: )" + outputShape + R"(,
110 dataType: )" + dataType + R"(
122 struct FullyConnectedWithNoBiasFixture : FullyConnectedFixture
124 FullyConnectedWithNoBiasFixture()
125 : FullyConnectedFixture("[ 1, 4, 1, 1 ]", // inputShape
126 "[ 1, 1 ]", // outputShape
127 "[ 1, 4 ]", // filterShape
128 "QuantisedAsymm8") // filterData
132 BOOST_FIXTURE_TEST_CASE(FullyConnectedWithNoBias, FullyConnectedWithNoBiasFixture)
134 RunTest<2, armnn::DataType::QAsymmU8>(
136 {{"InputLayer", { 10, 20, 30, 40 }}},
137 {{"OutputLayer", { 400/2 }}});
140 BOOST_AUTO_TEST_SUITE_END()