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(DeserializeParser)
14 struct FullyConnectedFixture : public ParserFlatbuffersSerializeFixture
16 explicit FullyConnectedFixture(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: 1.0,
52 layer_type: "FullyConnectedLayer",
56 layerName: "FullyConnectedLayer",
57 layerType: "FullyConnected",
60 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
65 dimensions: )" + outputShape + R"(,
66 dataType: )" + dataType + R"(,
67 quantizationScale: 2.0,
74 transposeWeightsMatrix: true
78 dimensions: )" + weightsShape + R"(,
79 dataType: )" + dataType + R"(,
80 quantizationScale: 1.0,
93 layer_type: "OutputLayer",
99 layerName: "OutputLayer",
103 connection: {sourceLayerIndex:1, outputSlotIndex:0 },
108 dimensions: )" + outputShape + R"(,
109 dataType: )" + dataType + R"(
121 struct FullyConnectedWithNoBiasFixture : FullyConnectedFixture
123 FullyConnectedWithNoBiasFixture()
124 : FullyConnectedFixture("[ 1, 4, 1, 1 ]", // inputShape
125 "[ 1, 1 ]", // outputShape
126 "[ 1, 4 ]", // filterShape
127 "QuantisedAsymm8") // filterData
131 BOOST_FIXTURE_TEST_CASE(FullyConnectedWithNoBias, FullyConnectedWithNoBiasFixture)
133 RunTest<2, armnn::DataType::QAsymmU8>(
135 {{"InputLayer", { 10, 20, 30, 40 }}},
136 {{"OutputLayer", { 400/2 }}});
139 BOOST_AUTO_TEST_SUITE_END()