13 explicit PadV2Fixture(
const std::string& inputShape,
14 const std::string& outputShape,
15 const std::string& padListShape,
16 const std::string& padListData,
17 const std::string& constantValuesShape,
18 const std::string& constantValuesData,
19 const std::string& dataType =
"FLOAT32",
20 const std::string& scale =
"1.0",
21 const std::string& offset =
"0")
26 "operator_codes": [ { "builtin_code": "PADV2" } ], 30 "shape": )" + inputShape + R"(, 31 "type": )" + dataType + R"(, 33 "name": "inputTensor", 37 "scale": [ )" + scale + R"( ], 38 "zero_point": [ )" + offset + R"( ], 42 "shape": )" + outputShape + R"(, 43 "type": )" + dataType + R"(, 45 "name": "outputTensor", 49 "scale": [ )" + scale + R"( ], 50 "zero_point": [ )" + offset + R"( ], 54 "shape": )" + padListShape + R"( , 66 "shape": )" + constantValuesShape + R"( , 67 "type": )" + dataType + R"(, 69 "name": "constantValues", 83 "inputs": [ 0, 2, 3 ], 85 "custom_options_format": "FLEXBUFFERS" 92 { "data": )" + padListData + R"(, }, 93 { "data": )" + constantValuesData + R"(, }, 101 struct SimplePadV2Fixture :
public PadV2Fixture
103 SimplePadV2Fixture() : PadV2Fixture(
"[ 2,3 ]",
"[ 4,7 ]",
"[ 2,2 ]",
104 "[ 1,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0 ]",
105 "[1]",
"[0,0,160,64]") {}
110 RunTest<2, armnn::DataType::Float32>
112 {{
"inputTensor", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f }}},
113 {{
"outputTensor", { 5.0f, 5.0f, 5.0f, 5.0f, 5.0f, 5.0f, 5.0f,
114 5.0f, 5.0f, 1.0f, 2.0f, 3.0f, 5.0f, 5.0f,
115 5.0f, 5.0f, 4.0f, 5.0f, 6.0f, 5.0f, 5.0f,
116 5.0f, 5.0f, 5.0f, 5.0f, 5.0f, 5.0f, 5.0f }}});
119 struct NoConstValuePadV2Fixture :
public PadV2Fixture
121 NoConstValuePadV2Fixture() : PadV2Fixture(
"[ 2,3 ]",
"[ 4,7 ]",
"[ 2,2 ]",
122 "[ 1,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0 ]",
128 RunTest<2, armnn::DataType::Float32>
130 {{
"inputTensor", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f }}},
131 {{
"outputTensor", { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, .0f,
132 0.0f, 0.0f, 1.0f, 2.0f, 3.0f, 0.0f, 0.0f,
133 0.0f, 0.0f, 4.0f, 5.0f, 6.0f, 0.0f, 0.0f,
134 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }}});
137 struct Uint8PadV2Fixture :
public PadV2Fixture
139 Uint8PadV2Fixture() : PadV2Fixture(
"[ 2,3 ]",
"[ 4,7 ]",
"[ 2,2 ]",
140 "[ 1,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0 ]",
141 "[1]",
"[1]",
"UINT8",
"-2.0",
"3") {}
146 RunTest<2, armnn::DataType::QAsymmU8>
148 {{
"inputTensor", { 1, 2, 3, 4, 5, 6 }}},
149 {{
"outputTensor", { 1, 1, 1, 1, 1, 1, 1,
152 1, 1, 1, 1, 1, 1, 1 }}});
155 struct Int8PadV2Fixture :
public PadV2Fixture
157 Int8PadV2Fixture() : PadV2Fixture(
"[ 2,3 ]",
"[ 4,7 ]",
"[ 2,2 ]",
158 "[ 1,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0 ]",
159 "[1]",
"[2]",
"INT8",
"-2.0",
"3") {}
164 RunTest<2, armnn::DataType::QAsymmS8>
166 {{
"inputTensor", { 1, -2, 3, 4, 5, -6 }}},
167 {{
"outputTensor", { 2, 2, 2, 2, 2, 2, 2,
168 2, 2, 1, -2, 3, 2, 2,
169 2, 2, 4, 5, -6, 2, 2,
170 2, 2, 2, 2, 2, 2, 2 }}});
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)