2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include <boost/test/unit_test.hpp>
7 #include "ParserFlatbuffersFixture.hpp"
8 #include "../TfLiteParser.hpp"
13 BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
15 struct MeanNoReduceFixture : public ParserFlatbuffersFixture
17 explicit MeanNoReduceFixture(const std::string & inputShape,
18 const std::string & outputShape,
19 const std::string & dimShape,
20 const std::string & dimData)
25 "operator_codes": [ { "builtin_code": "MEAN" } ],
29 "shape": )" + inputShape + R"(,
32 "name": "inputTensor",
41 "shape": )" + outputShape + R"( ,
44 "name": "outputTensor",
53 "shape": )" + dimShape + R"( ,
72 "custom_options_format": "FLEXBUFFERS"
79 { "data": )" + dimData + R"(, },
83 SetupSingleInputSingleOutput("inputTensor", "outputTensor");
87 struct SimpleMeanNoReduceFixture : public MeanNoReduceFixture
89 SimpleMeanNoReduceFixture() : MeanNoReduceFixture("[ 2, 2 ]", "[ 1, 1 ]", "[ 0 ]", "[ ]") {}
92 BOOST_FIXTURE_TEST_CASE(ParseMeanNoReduce, SimpleMeanNoReduceFixture)
94 RunTest<2, armnn::DataType::Float32>(0, {{ "inputTensor", { 1.0f, 1.0f, 2.0f, 2.0f } } },
95 {{ "outputTensor", { 1.5f } } });
98 BOOST_AUTO_TEST_SUITE_END()