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 AddFixture : public ParserFlatbuffersFixture
17 explicit AddFixture(const std::string & inputShape1,
18 const std::string & inputShape2,
19 const std::string & outputShape,
20 const std::string & activation="NONE")
25 "operator_codes": [ { "builtin_code": "ADD" } ],
29 "shape": )" + inputShape1 + R"(,
32 "name": "inputTensor1",
41 "shape": )" + inputShape2 + R"(,
44 "name": "inputTensor2",
53 "shape": )" + outputShape + R"( ,
56 "name": "outputTensor",
72 "builtin_options_type": "AddOptions",
74 "fused_activation_function": )" + activation + R"(
76 "custom_options_format": "FLEXBUFFERS"
91 struct SimpleAddFixture : AddFixture
93 SimpleAddFixture() : AddFixture("[ 2, 2 ]",
98 BOOST_FIXTURE_TEST_CASE(SimpleAdd, SimpleAddFixture)
100 RunTest<2, uint8_t>(0,
101 {{"inputTensor1", { 0, 1, 2, 3 }},
102 {"inputTensor2", { 4, 5, 6, 7 }}},
103 {{"outputTensor", { 4, 6, 8, 10 }}});
106 BOOST_AUTO_TEST_SUITE_END()