6 #include <boost/test/unit_test.hpp> 8 #include "../TfLiteParser.hpp" 17 explicit ReduceMaxFixture(
const std::string& inputShape,
18 const std::string& outputShape,
19 const std::string& axisShape,
20 const std::string& axisData)
25 "operator_codes": [ { "builtin_code": "REDUCE_MAX" } ], 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 SimpleReduceMaxFixture :
public ReduceMaxFixture
93 SimpleReduceMaxFixture() : ReduceMaxFixture(
"[ 1, 1, 2, 3 ]",
"[ 1, 1, 1, 3 ]",
"[ 1 ]",
"[ 2,0,0,0 ]") {}
98 RunTest<4, armnn::DataType::Float32, armnn::DataType::Float32>
99 (0, {{
"inputTensor", { 1001.0f, 11.0f, 1003.0f,
100 10.0f, 1002.0f, 12.0f } } },
101 {{
"outputTensor", { 1001.0f, 1002.0f, 1003.0f } } });
106 explicit ReduceMinFixture(
const std::string& inputShape,
107 const std::string& outputShape,
108 const std::string& axisShape,
109 const std::string& axisData)
114 "operator_codes": [ { "builtin_code": "REDUCE_MIN" } ], 118 "shape": )" + inputShape + R"(, 121 "name": "inputTensor", 130 "shape": )" + outputShape + R"( , 133 "name": "outputTensor", 142 "shape": )" + axisShape + R"( , 161 "builtin_options_type": "ReducerOptions", 165 "custom_options_format": "FLEXBUFFERS" 172 { "data": )" + axisData + R"(, }, 176 SetupSingleInputSingleOutput("inputTensor",
"outputTensor");
180 struct SimpleReduceMinFixture :
public ReduceMinFixture
182 SimpleReduceMinFixture() : ReduceMinFixture(
"[ 1, 1, 2, 3 ]",
"[ 1, 1, 1, 3 ]",
"[ 1 ]",
"[ 2, 0, 0, 0 ]") {}
187 RunTest<4, armnn::DataType::Float32, armnn::DataType::Float32>
188 (0, {{
"inputTensor", { 1001.0f, 11.0f, 1003.0f,
189 10.0f, 1002.0f, 12.0f } } },
190 {{
"outputTensor", { 10.0f, 11.0f, 12.0f } } });
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
BOOST_FIXTURE_TEST_CASE(ParseReduceMax, SimpleReduceMaxFixture)
BOOST_AUTO_TEST_SUITE_END()
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)