14 ReshapeMainFixture(
const std::string& dataType)
19 producer_version: "2.5.1" 28 elem_type: )" + dataType + R"( 90 ReshapeRank4Fixture(
const std::string& dataType)
95 producer_version: "2.5.1" 104 elem_type: )" + dataType + R"( 173 struct ReshapeValidFixture : ReshapeMainFixture
175 ReshapeValidFixture() : ReshapeMainFixture(
"1") {
180 struct ReshapeValidRank4Fixture : ReshapeRank4Fixture
182 ReshapeValidRank4Fixture() : ReshapeRank4Fixture(
"1") {
187 struct ReshapeInvalidFixture : ReshapeMainFixture
189 ReshapeInvalidFixture() : ReshapeMainFixture(
"10") { }
194 RunTest<2>({{
"Input", { 0.0f, 1.0f, 2.0f, 3.0f }}}, {{
"Output", { 0.0f, 1.0f, 2.0f, 3.0f }}});
201 {1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f,
202 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f,
203 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f}}},
205 {1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f,
206 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f,
207 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f}}});
217 ReshapeNegativeReshapeFixture(
const std::vector<int>& inputShape,
218 const std::vector<int>& shapeInputShape,
219 const std::vector<int>& outputShape,
220 const std::string& shape)
224 producer_name: "onnx-example" 280 struct ReshapeNegativeReshape1DFixture : ReshapeNegativeReshapeFixture
282 ReshapeNegativeReshape1DFixture() : ReshapeNegativeReshapeFixture({ 1, 3, 1, 2 }, { 1 }, { 6 },
"int64_data: -1")
288 struct ReshapeNegativeReshape2DFixture : ReshapeNegativeReshapeFixture
290 ReshapeNegativeReshape2DFixture() : ReshapeNegativeReshapeFixture({ 2, 3, 1, 2 },
293 "int64_data: -1 int64_data: 6")
299 struct ReshapeNegativeReshape3DFixture : ReshapeNegativeReshapeFixture
301 ReshapeNegativeReshape3DFixture() : ReshapeNegativeReshapeFixture({ 2, 3, 1, 2 },
304 "int64_data: 3 int64_data: -1 int64_data: 4")
310 struct ReshapeNegativeReshape4DFixture : ReshapeNegativeReshapeFixture
312 ReshapeNegativeReshape4DFixture() : ReshapeNegativeReshapeFixture(
316 "int64_data: 3 int64_data: 1 int64_data: 2 int64_data: -1")
322 TEST_CASE_FIXTURE(ReshapeNegativeReshape1DFixture,
"ReshapeNegativeReshape1DTest")
324 RunTest<1, float>({{
"Input", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f }}},
325 {{
"Output", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f }}});
328 TEST_CASE_FIXTURE(ReshapeNegativeReshape2DFixture,
"ReshapeNegativeReshape2DTest")
330 RunTest<2, float>({{
"Input", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
331 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f }}},
332 {{
"Output", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
333 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f }}});
336 TEST_CASE_FIXTURE(ReshapeNegativeReshape3DFixture,
"ReshapeNegativeReshape3DTest")
338 RunTest<3, float>({{
"Input", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
339 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f }}},
340 {{
"Output", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
341 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f }}});
344 TEST_CASE_FIXTURE(ReshapeNegativeReshape4DFixture,
"ReshapeNegativeReshape4DTest")
346 RunTest<4, float>({{
"Input", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
347 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f }}},
348 {{
"Output", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
349 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f }}});
354 ReshapeNonConstShapeFixture(
const std::vector<int>& inputShape,
355 const std::vector<int>& shapeInputShape,
356 const std::vector<int>& outputShape)
360 producer_name: "onnx-example" 410 struct ReshapeNonConst1DShapeFixture : ReshapeNonConstShapeFixture
412 ReshapeNonConst1DShapeFixture() : ReshapeNonConstShapeFixture({ 1, 3, 1, 2 }, { 1 }, { 6 })
418 struct ReshapeNonConst2DShapeFixture : ReshapeNonConstShapeFixture
420 ReshapeNonConst2DShapeFixture() : ReshapeNonConstShapeFixture({ 2, 3, 2, 2 }, { 2 }, { 2, 12 })
426 struct ReshapeInvalidNonConstShapeFixture : ReshapeNonConstShapeFixture
428 ReshapeInvalidNonConstShapeFixture() : ReshapeNonConstShapeFixture({ 2, 3, 2, 2 }, { 3 }, { 2, 3, 4 })
433 struct ReshapeInvalidDimNonConstShapeFixture : ReshapeNonConstShapeFixture
435 ReshapeInvalidDimNonConstShapeFixture() : ReshapeNonConstShapeFixture({ 2, 3, 2, 2 }, { 1, 2 }, { 2, 3, 4 })
442 RunTest<1, float>({{
"Input", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f }}},
443 {{
"Output", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f }}});
448 RunTest<2, float>({{
"Input", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
449 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
450 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f,
451 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f }}},
452 {{
"Output", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
453 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
454 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f,
455 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f }}});
458 TEST_CASE_FIXTURE(ReshapeInvalidNonConstShapeFixture,
"ReshapeInvalidNonConstShapeTest")
463 TEST_CASE_FIXTURE(ReshapeInvalidDimNonConstShapeFixture,
"ReshapeInvalidDimNonConstShapeTest")
std::string ConstructTensorShapeString(const std::vector< int > &shape)
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")
TEST_SUITE("OnnxParser_Reshape")