13 explicit SpaceToBatchNDFixture(
const std::string & inputShape,
14 const std::string & outputShape,
15 const std::string & blockShapeData,
16 const std::string & padListData)
21 "operator_codes": [ { "builtin_code": "SPACE_TO_BATCH_ND" } ], 25 "shape": )" + inputShape + R"(, 28 "name": "inputTensor", 37 "shape": )" + outputShape + R"(, 40 "name": "outputTensor", 52 "name": "blockShapeTensor", 64 "name": "padListTensor", 78 "inputs": [ 0, 2, 3 ], 80 "custom_options_format": "FLEXBUFFERS" 87 { "data": )" + blockShapeData + R"(, }, 88 { "data": )" + padListData + R"(, }, 96 struct SpaceToBatchNDFixtureSimpleTest :
public SpaceToBatchNDFixture
98 SpaceToBatchNDFixtureSimpleTest() : SpaceToBatchNDFixture(
"[ 1, 4, 4, 1 ]",
100 "[ 2,0,0,0, 2,0,0,0 ]",
101 "[ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ]") {}
106 RunTest<4, armnn::DataType::Float32>
108 {{
"inputTensor", { 1.0f, 2.0f, 3.0f, 4.0f,
109 5.0f, 6.0f, 7.0f, 8.0f,
110 9.0f, 10.0f, 11.0f, 12.0f,
111 13.0f, 14.0f, 15.0f, 16.0f }}},
112 {{
"outputTensor", { 1.0f, 3.0f, 9.0f, 11.0f,
113 2.0f, 4.0f, 10.0f, 12.0f,
114 5.0f, 7.0f, 13.0f, 15.0f,
115 6.0f, 8.0f, 14.0f, 16.0f }}});
119 struct SpaceToBatchNDFixtureMultipleInputBatchesTest :
public SpaceToBatchNDFixture
121 SpaceToBatchNDFixtureMultipleInputBatchesTest() : SpaceToBatchNDFixture(
"[ 2, 2, 4, 1 ]",
123 "[ 2,0,0,0, 2,0,0,0 ]",
124 "[ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ]") {}
127 TEST_CASE_FIXTURE(SpaceToBatchNDFixtureMultipleInputBatchesTest,
"SpaceToBatchNdMultipleInputBatchesTest")
129 RunTest<4, armnn::DataType::Float32>
131 {{
"inputTensor", { 1.0f, 2.0f, 3.0f, 4.0f,
132 5.0f, 6.0f, 7.0f, 8.0f,
133 9.0f, 10.0f, 11.0f, 12.0f,
134 13.0f, 14.0f, 15.0f, 16.0f }}},
135 {{
"outputTensor", { 1.0f, 3.0f, 9.0f, 11.0f,
136 2.0f, 4.0f, 10.0f, 12.0f,
137 5.0f, 7.0f, 13.0f, 15.0f,
138 6.0f, 8.0f, 14.0f, 16.0f }}});
141 struct SpaceToBatchNDFixturePaddingTest :
public SpaceToBatchNDFixture
143 SpaceToBatchNDFixturePaddingTest() : SpaceToBatchNDFixture(
"[ 1, 5, 2, 1 ]",
145 "[ 3,0,0,0, 2,0,0,0 ]",
146 "[ 1,0,0,0, 0,0,0,0, 2,0,0,0, 0,0,0,0 ]") {}
151 RunTest<4, armnn::DataType::Float32>
153 {{
"inputTensor", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f,
154 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }}},
155 {{
"outputTensor", { 0.0f, 0.0f,
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")
void Setup(bool testDynamic=true)