13 explicit GatherFixture(
const std::string& paramsShape,
14 const std::string& outputShape,
15 const std::string& indicesShape,
16 const std::string& dataType =
"FLOAT32",
17 const std::string& scale =
"1.0",
18 const std::string& offset =
"0")
23 "operator_codes": [ { "builtin_code": "GATHER" } ], 27 "shape": )" + paramsShape + R"(, 28 "type": )" + dataType + R"(, 30 "name": "inputTensor", 34 "scale": [ )" + scale + R"( ], 35 "zero_point": [ )" + offset + R"( ], 39 "shape": )" + indicesShape + R"( , 51 "shape": )" + outputShape + R"(, 52 "type": )" + dataType + R"(, 54 "name": "outputTensor", 58 "scale": [ )" + scale + R"( ], 59 "zero_point": [ )" + offset + R"( ], 70 "builtin_options_type": "GatherOptions", 74 "custom_options_format": "FLEXBUFFERS" 89 struct SimpleGatherFixture :
public GatherFixture
91 SimpleGatherFixture() : GatherFixture(
"[ 5, 2 ]",
"[ 3, 2 ]",
"[ 3 ]") {}
96 RunTest<2, armnn::DataType::Float32, armnn::DataType::Signed32, armnn::DataType::Float32>
98 {{
"inputTensor", { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }}},
99 {{
"indices", { 1, 3, 4 }}},
100 {{
"outputTensor", { 3, 4, 7, 8, 9, 10 }}});
103 struct GatherUint8Fixture :
public GatherFixture
105 GatherUint8Fixture() : GatherFixture(
"[ 8 ]",
"[ 3 ]",
"[ 3 ]",
"UINT8") {}
110 RunTest<1, armnn::DataType::QAsymmU8, armnn::DataType::Signed32, armnn::DataType::QAsymmU8>
112 {{
"inputTensor", { 1, 2, 3, 4, 5, 6, 7, 8 }}},
113 {{
"indices", { 7, 6, 5 }}},
114 {{
"outputTensor", { 8, 7, 6 }}});
TEST_SUITE("OnnxParser_Gather")
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")
void Setup(bool testDynamic=true)