14 explicit LoadScopeDynamicTensorFixture(
const std::string& shape0,
15 const std::string& shape1,
16 const std::string& shape2)
23 "builtin_code": "AVERAGE_POOL_2D", 27 "builtin_code": "SOFTMAX", 35 "shape": )" + shape0 + R"(, 41 "quantized_dimension": 0 46 "shape": )" + shape1 + R"(, 52 "quantized_dimension": 0 57 "shape": )" + shape2 + R"(, 60 "name": "model/average_pooling2d/AvgPool", 63 "quantized_dimension": 0 83 "builtin_options_type": "SoftmaxOptions", 87 "custom_options_format": "FLEXBUFFERS" 97 "builtin_options_type": "Pool2DOptions", 104 "fused_activation_function": "NONE" 106 "custom_options_format": "FLEXBUFFERS" 112 "description": "MLIR Converted.", 129 struct LoadScopeDynamicTensor0Fixture : LoadScopeDynamicTensorFixture
131 LoadScopeDynamicTensor0Fixture() : LoadScopeDynamicTensorFixture(
"[ 1, 2, 3, 2 ]",
"[]",
"[]") {}
134 struct LoadScopeDynamicTensor1Fixture : LoadScopeDynamicTensorFixture
136 LoadScopeDynamicTensor1Fixture() : LoadScopeDynamicTensorFixture(
"[ 1, 2, 4, 1 ]",
"[ 1, 1, 2, 1 ]",
"[]") {}
139 struct LoadScopeDynamicTensor2Fixture : LoadScopeDynamicTensorFixture
141 LoadScopeDynamicTensor2Fixture() : LoadScopeDynamicTensorFixture(
"[ 1, 3, 3, 2 ]",
"[ ]",
"[ 1, 1, 1, 2 ]") {}
146 RunTest<4, armnn::DataType::Float32, armnn::DataType::Float32>(
148 { {
"input0", { 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f }} },
149 { {
"output", { 0.26894143f, 0.7310586f }} },
155 RunTest<4, armnn::DataType::Float32, armnn::DataType::Float32>(
157 { {
"input0", { 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f }} },
158 { {
"output", { 1.f, 1.f }} },
164 RunTest<4, armnn::DataType::Float32, armnn::DataType::Float32>(
166 { {
"input0", { 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f }} },
167 { {
"output", { 0.7772999f, 0.22270015f }} },
173 explicit LoadScopeDynamicTensorBroadcastingFixture(
const std::string& inputShape0,
174 const std::string& inputShape1,
175 const std::string& inputShape2,
176 const std::string& addShape,
177 const std::string& outputShape)
184 "builtin_code": "ADD", 188 "builtin_code": "SUB", 196 "shape": )" + inputShape0 + R"(, 202 "quantized_dimension": 0 207 "shape": )" + inputShape1 + R"(, 213 "quantized_dimension": 0 218 "shape": )" + outputShape + R"(, 224 "quantized_dimension": 0 230 "shape": )" + addShape + R"(, 233 "name": "model/add/add", 236 "quantized_dimension": 0 241 "shape": )" + inputShape2 + R"(, 247 "quantized_dimension": 0 270 "builtin_options_type": "AddOptions", 272 "fused_activation_function": "NONE" 274 "custom_options_format": "FLEXBUFFERS" 285 "builtin_options_type": "SubOptions", 287 "fused_activation_function": "NONE" 289 "custom_options_format": "FLEXBUFFERS" 315 struct LoadScopeDynamicTensorBroadcasting3DFixture : LoadScopeDynamicTensorBroadcastingFixture
317 LoadScopeDynamicTensorBroadcasting3DFixture() : LoadScopeDynamicTensorBroadcastingFixture(
"[ 1, 2, 3, 2 ]",
320 "[ 1, 2, 3, 2 ]",
"[]") {}
323 struct LoadScopeDynamicTensorBroadcasting2DFixture : LoadScopeDynamicTensorBroadcastingFixture
325 LoadScopeDynamicTensorBroadcasting2DFixture() : LoadScopeDynamicTensorBroadcastingFixture(
"[ 1, 2, 3, 2 ]",
331 struct LoadScopeDynamicTensorBroadcasting1DFixture : LoadScopeDynamicTensorBroadcastingFixture
333 LoadScopeDynamicTensorBroadcasting1DFixture() : LoadScopeDynamicTensorBroadcastingFixture(
"[ 1, 2, 3, 2 ]",
340 TEST_CASE_FIXTURE(LoadScopeDynamicTensorBroadcasting3DFixture,
"LoadScopeDynamicTensorBroadcasting3D")
342 RunTest<4, armnn::DataType::Float32, armnn::DataType::Float32>(
344 { {
"input0", { 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f }},
345 {
"input1", { 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f, 12.f, 13.f, 14.f }},
346 {
"input2", { 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f, 12.f }}
348 { {
"output", { 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f, 12.f, 13.f }} },
352 TEST_CASE_FIXTURE(LoadScopeDynamicTensorBroadcasting2DFixture,
"LoadScopeDynamicTensorBroadcasting2D")
354 RunTest<4, armnn::DataType::Float32, armnn::DataType::Float32>(
356 { {
"input0", { 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f }},
357 {
"input1", { 3.f, 4.f, 5.f, 6.f, 7.f, 8.f }},
358 {
"input2", { -1.f, -2.f, 3.f, 4.f, 5.f, 6.f }}
360 { {
"output", { 4.f, 7.f, 4.f, 5.f, 6.f, 7.f, 10.f, 13.f, 10.f, 11.f, 12.f, 13.f }} },
364 TEST_CASE_FIXTURE(LoadScopeDynamicTensorBroadcasting1DFixture,
"LoadScopeDynamicTensorBroadcasting1D")
366 RunTest<4, armnn::DataType::Float32, armnn::DataType::Float32>(
368 { {
"input0", { 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f }},
372 { {
"output", { 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 11.f, 12.f, 13.f, 14.f, 15.f }} },
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")
void Setup(bool testDynamic=true)