13 explicit ReshapeFixture(
const std::string& inputShape,
14 const std::string& outputShape,
15 const std::string& newShape)
20 "operator_codes": [ { "builtin_code": "RESHAPE" } ], 25 "shape" : )" + inputShape + ",";
29 "name": "inputTensor", 39 "shape" : )" + outputShape; 43 "name": "outputTensor", 59 "builtin_options_type": "ReshapeOptions", 60 "builtin_options": {)"; 61 if (!newShape.empty())
63 m_JsonString += R
"("new_shape" : )" + newShape; 66 "custom_options_format": "FLEXBUFFERS" 70 "buffers" : [ {}, {} ] 77 struct ReshapeFixtureWithReshapeDims : ReshapeFixture
79 ReshapeFixtureWithReshapeDims() : ReshapeFixture(
"[ 1, 9 ]",
"[ 3, 3 ]",
"[ 3, 3 ]") {}
84 SetupSingleInputSingleOutput(
"inputTensor",
"outputTensor");
85 RunTest<2, armnn::DataType::QAsymmU8>(0,
86 { 1, 2, 3, 4, 5, 6, 7, 8, 9 },
87 { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
88 CHECK((m_Parser->GetNetworkOutputBindingInfo(0,
"outputTensor").second.GetShape()
92 struct ReshapeFixtureWithReshapeDimsFlatten : ReshapeFixture
94 ReshapeFixtureWithReshapeDimsFlatten() : ReshapeFixture(
"[ 3, 3 ]",
"[ 9 ]",
"[ -1 ]") {}
97 TEST_CASE_FIXTURE(ReshapeFixtureWithReshapeDimsFlatten,
"ParseReshapeWithReshapeDimsFlatten")
99 SetupSingleInputSingleOutput(
"inputTensor",
"outputTensor");
100 RunTest<1, armnn::DataType::QAsymmU8>(0,
101 { 1, 2, 3, 4, 5, 6, 7, 8, 9 },
102 { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
103 CHECK((m_Parser->GetNetworkOutputBindingInfo(0,
"outputTensor").second.GetShape()
107 struct ReshapeFixtureWithReshapeDimsFlattenTwoDims : ReshapeFixture
109 ReshapeFixtureWithReshapeDimsFlattenTwoDims() : ReshapeFixture(
"[ 3, 2, 3 ]",
"[ 2, 9 ]",
"[ 2, -1 ]") {}
112 TEST_CASE_FIXTURE(ReshapeFixtureWithReshapeDimsFlattenTwoDims,
"ParseReshapeWithReshapeDimsFlattenTwoDims")
114 SetupSingleInputSingleOutput(
"inputTensor",
"outputTensor");
115 RunTest<2, armnn::DataType::QAsymmU8>(0,
116 { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 },
117 { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 });
118 CHECK((m_Parser->GetNetworkOutputBindingInfo(0,
"outputTensor").second.GetShape()
122 struct ReshapeFixtureWithReshapeDimsFlattenOneDim : ReshapeFixture
124 ReshapeFixtureWithReshapeDimsFlattenOneDim() : ReshapeFixture(
"[ 2, 9 ]",
"[ 2, 3, 3 ]",
"[ 2, -1, 3 ]") {}
127 TEST_CASE_FIXTURE(ReshapeFixtureWithReshapeDimsFlattenOneDim,
"ParseReshapeWithReshapeDimsFlattenOneDim")
129 SetupSingleInputSingleOutput(
"inputTensor",
"outputTensor");
130 RunTest<3, armnn::DataType::QAsymmU8>(0,
131 { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 },
132 { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 });
133 CHECK((m_Parser->GetNetworkOutputBindingInfo(0,
"outputTensor").second.GetShape()
137 struct DynamicReshapeFixtureWithReshapeDimsFlattenOneDim : ReshapeFixture
139 DynamicReshapeFixtureWithReshapeDimsFlattenOneDim() : ReshapeFixture(
"[ 2, 9 ]",
144 TEST_CASE_FIXTURE(DynamicReshapeFixtureWithReshapeDimsFlattenOneDim,
"DynParseReshapeWithReshapeDimsFlattenOneDim")
146 SetupSingleInputSingleOutput(
"inputTensor",
"outputTensor");
149 armnn::DataType::QAsymmU8>(0,
150 { {
"inputTensor", { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 } } },
151 { {
"outputTensor", { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 } } },
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")