6 #include <boost/test/unit_test.hpp> 8 #include "../TfLiteParser.hpp" 17 explicit SumFixture(
const std::string& inputShape,
18 const std::string& outputShape,
19 const std::string& axisShape,
20 const std::string& axisData)
25 "operator_codes": [ { "builtin_code": "SUM" } ], 29 "shape": )" + inputShape + R"(, 32 "name": "inputTensor", 41 "shape": )" + outputShape + R"( , 44 "name": "outputTensor", 53 "shape": )" + axisShape + R"( , 72 "builtin_options_type": "ReducerOptions", 76 "custom_options_format": "FLEXBUFFERS" 83 { "data": )" + axisData + R"(, }, 91 struct SimpleSumFixture :
public SumFixture
93 SimpleSumFixture() : SumFixture(
"[ 1, 3, 2, 4 ]",
"[ 1, 1, 1, 4 ]",
"[ 2 ]",
"[ 1, 0, 0, 0, 2, 0, 0, 0 ]") {}
98 RunTest<4, armnn::DataType::Float32, armnn::DataType::Float32>
99 (0, {{
"inputTensor", { 1.0f, 2.0f, 3.0f, 4.0f,
100 5.0f, 6.0f, 7.0f, 8.0f,
102 10.0f, 20.0f, 30.0f, 40.0f,
103 50.0f, 60.0f, 70.0f, 80.0f,
105 100.0f, 200.0f, 300.0f, 400.0f,
106 500.0f, 600.0f, 700.0f, 800.0f } } },
107 {{
"outputTensor", { 666.0f, 888.0f, 1110.0f, 1332.0f } } });
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
BOOST_FIXTURE_TEST_CASE(ParseSum, SimpleSumFixture)
BOOST_AUTO_TEST_SUITE_END()
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)