13 explicit PadFixture(
const std::string& inputShape,
14 const std::string& outputShape,
15 const std::string& padListShape,
16 const std::string& padListData,
17 const std::string& dataType =
"FLOAT32",
18 const std::string& scale =
"1.0",
19 const std::string& offset =
"0")
24 "operator_codes": [ { "builtin_code": "PAD" } ], 28 "shape": )" + inputShape + R"(, 29 "type": )" + dataType + R"(, 31 "name": "inputTensor", 35 "scale": [ )" + scale + R"( ], 36 "zero_point": [ )" + offset + R"( ], 40 "shape": )" + outputShape + R"(, 41 "type": )" + dataType + R"(, 43 "name": "outputTensor", 47 "scale": [ )" + scale + R"( ], 48 "zero_point": [ )" + offset + R"( ], 52 "shape": )" + padListShape + R"( , 71 "custom_options_format": "FLEXBUFFERS" 78 { "data": )" + padListData + R"(, }, 86 struct SimplePadFixture :
public PadFixture
88 SimplePadFixture() : PadFixture(
"[ 2, 3 ]",
"[ 4, 7 ]",
"[ 2, 2 ]",
89 "[ 1,0,0,0, 1,0,0,0, 2,0,0,0, 2,0,0,0 ]") {}
94 RunTest<2, armnn::DataType::Float32>
96 {{
"inputTensor", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f }}},
97 {{
"outputTensor", { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
98 0.0f, 0.0f, 1.0f, 2.0f, 3.0f, 0.0f, 0.0f,
99 0.0f, 0.0f, 4.0f, 5.0f, 6.0f, 0.0f, 0.0f,
100 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }}});
103 struct Uint8PadFixture :
public PadFixture
105 Uint8PadFixture() : PadFixture(
"[ 2, 3 ]",
"[ 4, 7 ]",
"[ 2, 2 ]",
106 "[ 1,0,0,0, 1,0,0,0, 2,0,0,0, 2,0,0,0 ]",
107 "UINT8",
"-2.0",
"3") {}
112 RunTest<2, armnn::DataType::QAsymmU8>
114 {{
"inputTensor", { 1, 2, 3, 4, 5, 6 }}},
115 {{
"outputTensor", { 3, 3, 3, 3, 3, 3, 3,
118 3, 3, 3, 3, 3, 3, 3 }}});
121 struct Int8PadFixture :
public PadFixture
123 Int8PadFixture() : PadFixture(
"[ 2, 3 ]",
"[ 4, 7 ]",
"[ 2, 2 ]",
124 "[ 1,0,0,0, 1,0,0,0, 2,0,0,0, 2,0,0,0 ]",
125 "INT8",
"-2.0",
"3") {}
130 RunTest<2, armnn::DataType::QAsymmS8>
132 {{
"inputTensor", { 1, -2, 3, 4, 5, -6 }}},
133 {{
"outputTensor", { 3, 3, 3, 3, 3, 3, 3,
134 3, 3, 1, -2, 3, 3, 3,
135 3, 3, 4, 5, -6, 3, 3,
136 3, 3, 3, 3, 3, 3, 3 }}});
TEST_SUITE("TensorflowLiteParser_Pad")
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)