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 MeanFixture : public ParserFlatbuffersSerializeFixture
17 explicit MeanFixture(const std::string &inputShape,
18 const std::string &outputShape,
19 const std::string &axis,
20 const std::string &dataType)
28 layer_type: "InputLayer",
34 layerName: "InputLayer",
38 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
43 dimensions: )" + inputShape + R"(,
44 dataType: )" + dataType + R"(
52 layer_type: "MeanLayer",
56 layerName: "MeanLayer",
60 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
65 dimensions: )" + outputShape + R"(,
66 dataType: )" + dataType + R"(
71 axis: )" + axis + R"(,
77 layer_type: "OutputLayer",
83 layerName: "OutputLayer",
87 connection: {sourceLayerIndex:1, outputSlotIndex:0 },
92 dimensions: )" + outputShape + R"(,
93 dataType: )" + dataType + R"(
107 struct SimpleMeanFixture : MeanFixture
110 : MeanFixture("[ 1, 1, 3, 2 ]", // inputShape
111 "[ 1, 1, 1, 2 ]", // outputShape
113 "Float32") // dataType
117 BOOST_FIXTURE_TEST_CASE(SimpleMean, SimpleMeanFixture)
119 RunTest<4, armnn::DataType::Float32>(
121 {{"InputLayer", { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f }}},
122 {{"OutputLayer", { 2.0f, 2.0f }}});
125 BOOST_AUTO_TEST_SUITE_END()