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 MeanFixture : public ParserFlatbuffersSerializeFixture
16 explicit MeanFixture(const std::string &inputShape,
17 const std::string &outputShape,
18 const std::string &axis,
19 const std::string &dataType)
27 layer_type: "InputLayer",
33 layerName: "InputLayer",
37 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
42 dimensions: )" + inputShape + R"(,
43 dataType: )" + dataType + R"(
51 layer_type: "MeanLayer",
55 layerName: "MeanLayer",
59 connection: {sourceLayerIndex:0, outputSlotIndex:0 },
64 dimensions: )" + outputShape + R"(,
65 dataType: )" + dataType + R"(
70 axis: )" + axis + R"(,
76 layer_type: "OutputLayer",
82 layerName: "OutputLayer",
86 connection: {sourceLayerIndex:1, outputSlotIndex:0 },
91 dimensions: )" + outputShape + R"(,
92 dataType: )" + dataType + R"(
106 struct SimpleMeanFixture : MeanFixture
109 : MeanFixture("[ 1, 1, 3, 2 ]", // inputShape
110 "[ 1, 1, 1, 2 ]", // outputShape
112 "Float32") // dataType
116 BOOST_FIXTURE_TEST_CASE(SimpleMean, SimpleMeanFixture)
118 RunTest<4, armnn::DataType::Float32>(
120 {{"InputLayer", { 1.0f, 1.0f, 2.0f, 2.0f, 3.0f, 3.0f }}},
121 {{"OutputLayer", { 2.0f, 2.0f }}});
124 BOOST_AUTO_TEST_SUITE_END()