6 #include <boost/test/unit_test.hpp> 8 #include "../TfLiteParser.hpp" 17 explicit GatherFixture(
const std::string& paramsShape,
18 const std::string& outputShape,
19 const std::string& indicesShape,
20 const std::string& dataType =
"FLOAT32",
21 const std::string& scale =
"1.0",
22 const std::string& offset =
"0")
27 "operator_codes": [ { "builtin_code": "GATHER" } ], 31 "shape": )" + paramsShape + R"(, 32 "type": )" + dataType + R"(, 34 "name": "inputTensor", 38 "scale": [ )" + scale + R"( ], 39 "zero_point": [ )" + offset + R"( ], 43 "shape": )" + indicesShape + R"( , 55 "shape": )" + outputShape + R"(, 56 "type": )" + dataType + R"(, 58 "name": "outputTensor", 62 "scale": [ )" + scale + R"( ], 63 "zero_point": [ )" + offset + R"( ], 74 "builtin_options_type": "GatherOptions", 78 "custom_options_format": "FLEXBUFFERS" 93 struct SimpleGatherFixture :
public GatherFixture
95 SimpleGatherFixture() : GatherFixture(
"[ 5, 2 ]",
"[ 3, 2 ]",
"[ 3 ]") {}
100 RunTest<2, armnn::DataType::Float32, armnn::DataType::Signed32, armnn::DataType::Float32>
102 {{
"inputTensor", { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }}},
103 {{
"indices", { 1, 3, 4 }}},
104 {{
"outputTensor", { 3, 4, 7, 8, 9, 10 }}});
107 struct GatherUint8Fixture :
public GatherFixture
109 GatherUint8Fixture() : GatherFixture(
"[ 8 ]",
"[ 3 ]",
"[ 3 ]",
"UINT8") {}
114 RunTest<1, armnn::DataType::QAsymmU8, armnn::DataType::Signed32, armnn::DataType::QAsymmU8>
116 {{
"inputTensor", { 1, 2, 3, 4, 5, 6, 7, 8 }}},
117 {{
"indices", { 7, 6, 5 }}},
118 {{
"outputTensor", { 8, 7, 6 }}});
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
BOOST_AUTO_TEST_SUITE_END()
BOOST_FIXTURE_TEST_CASE(ParseGather, SimpleGatherFixture)