15 GatherMainFixture(
const std::vector<int>& indicesShape,
16 const std::vector<int>& indices,
17 const std::vector<int>& inputShape,
18 const std::vector<int>& outputShape)
22 producer_name: "onnx-example" 31 )" + ConstructIndicesString(indicesShape, indices) + R"( 73 std::string ConstructIndicesString(const std::vector<int>& indicesShape,
const std::vector<int>& indices)
76 for (
int i : indicesShape)
78 shapeStr = fmt::format(
" {} dims: {}", shapeStr, i);
82 shapeStr = fmt::format(
" {} int64_data: {}", shapeStr, i);
88 struct GatherScalarFixture : GatherMainFixture
90 GatherScalarFixture() : GatherMainFixture({ }, { 0 }, { 8 }, { })
96 struct Gather1dFixture : GatherMainFixture
98 Gather1dFixture() : GatherMainFixture({ 4 }, { 0, 2, 1, 5 }, { 8 }, { 4 })
104 struct Gather2dFixture : GatherMainFixture
106 Gather2dFixture() : GatherMainFixture({ 3 }, { 1, 3, 4 }, { 5, 2 }, { 3, 2 })
112 struct Gather3dMultiIndicesFixture : GatherMainFixture
114 Gather3dMultiIndicesFixture() : GatherMainFixture({ 2, 3 }, { 1, 2, 1, 2, 1, 0 }, { 3, 2, 3 }, { 2, 3, 2, 3 })
120 struct Gather4dFixture : GatherMainFixture
122 Gather4dFixture() : GatherMainFixture({ 3 }, { 0, 1, 3 }, { 5, 4, 3, 2 }, { 3, 4, 3, 2 })
130 RunTest<1, float>({{
"input", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }}},
131 {{
"output", { 1.0f }}});
136 RunTest<1, float>({{
"input", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f }}},
137 {{
"output", { 1.0f, 3.0f, 2.0f, 6.0f }}});
142 RunTest<2, float>({{
"input", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }}},
143 {{
"output", { 3.0f, 4.0f, 7.0f, 8.0f, 9.0f, 10.0f }}});
148 RunTest<3, float>({{
"input", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
149 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
150 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f }}},
151 {{
"output", { 7.0f, 8.0f, 9.0f,
162 4.0f, 5.0f, 6.0f }}});
167 RunTest<4, float>({{
"input", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f,
168 6.0f, 7.0f, 8.0f, 9.0f, 10.0f,
169 11.0f, 12.0f, 13.0f, 14.0f, 15.0f,
170 16.0f, 17.0f, 18.0f, 19.0f, 20.0f,
171 21.0f, 22.0f, 23.0f, 24.0f, 25.0f,
172 26.0f, 27.0f, 28.0f, 29.0f, 30.0f,
173 31.0f, 32.0f, 33.0f, 34.0f, 35.0f,
174 36.0f, 37.0f, 38.0f, 39.0f, 40.0f,
175 41.0f, 42.0f, 43.0f, 44.0f, 45.0f,
176 46.0f, 47.0f, 48.0f, 49.0f, 50.0f,
177 51.0f, 52.0f, 53.0f, 54.0f, 55.0f,
178 56.0f, 57.0f, 58.0f, 59.0f, 60.0f,
179 61.0f, 62.0f, 63.0f, 64.0f, 65.0f,
180 66.0f, 67.0f, 68.0f, 69.0f, 70.0f,
181 71.0f, 72.0f, 73.0f, 74.0f, 75.0f,
182 76.0f, 77.0f, 78.0f, 79.0f, 80.0f,
183 81.0f, 82.0f, 83.0f, 84.0f, 85.0f,
184 86.0f, 87.0f, 88.0f, 89.0f, 90.0f,
185 91.0f, 92.0f, 93.0f, 94.0f, 95.0f,
186 96.0f, 97.0f, 98.0f, 99.0f, 100.0f,
187 101.0f, 102.0f, 103.0f, 104.0f, 105.0f,
188 106.0f, 107.0f, 108.0f, 109.0f, 110.0f,
189 111.0f, 112.0f, 113.0f, 114.0f, 115.0f,
190 116.0f, 117.0f, 118.0f, 119.0f, 120.0f }}},
191 {{
"output", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
192 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
193 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f,
194 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f,
195 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f,
196 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f,
197 37.0f, 38.0f, 39.0f, 40.0f, 41.0f, 42.0f,
198 43.0f, 44.0f, 45.0f, 46.0f, 47.0f, 48.0f,
199 73.0f, 74.0f, 75.0f, 76.0f, 77.0f, 78.0f,
200 79.0f, 80.0f, 81.0f, 82.0f, 83.0f, 84.0f,
201 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, 90.0f,
202 91.0f, 92.0f, 93.0f, 94.0f, 95.0f, 96.0f }}});
207 GatherRawDataFixture()
211 producer_name: "onnx-example" 222 "\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\003\000\000\000\000\000\000\000" 291 RunTest<4, float>({{
"input", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f,
292 6.0f, 7.0f, 8.0f, 9.0f, 10.0f,
293 11.0f, 12.0f, 13.0f, 14.0f, 15.0f,
294 16.0f, 17.0f, 18.0f, 19.0f, 20.0f,
295 21.0f, 22.0f, 23.0f, 24.0f, 25.0f,
296 26.0f, 27.0f, 28.0f, 29.0f, 30.0f,
297 31.0f, 32.0f, 33.0f, 34.0f, 35.0f,
298 36.0f, 37.0f, 38.0f, 39.0f, 40.0f,
299 41.0f, 42.0f, 43.0f, 44.0f, 45.0f,
300 46.0f, 47.0f, 48.0f, 49.0f, 50.0f,
301 51.0f, 52.0f, 53.0f, 54.0f, 55.0f,
302 56.0f, 57.0f, 58.0f, 59.0f, 60.0f,
303 61.0f, 62.0f, 63.0f, 64.0f, 65.0f,
304 66.0f, 67.0f, 68.0f, 69.0f, 70.0f,
305 71.0f, 72.0f, 73.0f, 74.0f, 75.0f,
306 76.0f, 77.0f, 78.0f, 79.0f, 80.0f,
307 81.0f, 82.0f, 83.0f, 84.0f, 85.0f,
308 86.0f, 87.0f, 88.0f, 89.0f, 90.0f,
309 91.0f, 92.0f, 93.0f, 94.0f, 95.0f,
310 96.0f, 97.0f, 98.0f, 99.0f, 100.0f,
311 101.0f, 102.0f, 103.0f, 104.0f, 105.0f,
312 106.0f, 107.0f, 108.0f, 109.0f, 110.0f,
313 111.0f, 112.0f, 113.0f, 114.0f, 115.0f,
314 116.0f, 117.0f, 118.0f, 119.0f, 120.0f }}},
315 {{
"output", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f,
316 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f,
317 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f,
318 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f,
319 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f,
320 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f,
321 37.0f, 38.0f, 39.0f, 40.0f, 41.0f, 42.0f,
322 43.0f, 44.0f, 45.0f, 46.0f, 47.0f, 48.0f,
323 73.0f, 74.0f, 75.0f, 76.0f, 77.0f, 78.0f,
324 79.0f, 80.0f, 81.0f, 82.0f, 83.0f, 84.0f,
325 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, 90.0f,
326 91.0f, 92.0f, 93.0f, 94.0f, 95.0f, 96.0f }}});
std::string ConstructTensorShapeString(const std::vector< int > &shape)
TEST_SUITE("OnnxParser_Gather")
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")