Skip to content

Commit eff64e6

Browse files
Arm backend: Add tests that require size_adjust pass
Change-Id: I84e9cb02f18cb1c81a27156b6e9d946c11291adf
1 parent ed40f7a commit eff64e6

File tree

2 files changed

+151
-3
lines changed

2 files changed

+151
-3
lines changed

backends/arm/test/ops/test_conv1d.py

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Arm Limited and/or its affiliates.
1+
# Copyright 2024-2025 Arm Limited and/or its affiliates.
22
# All rights reserved.
33
#
44
# This source code is licensed under the BSD-style license found in the
@@ -180,6 +180,47 @@ def forward(self, x):
180180
batches=1,
181181
)
182182

183+
conv1d_7_1x3x16_st2_pd1_dl2 = Conv1d(
184+
in_channels=3,
185+
out_channels=3,
186+
kernel_size=7,
187+
stride=2,
188+
padding=1,
189+
dilation=2,
190+
length=16,
191+
batches=1,
192+
)
193+
conv1d_7_1x3x15_st1_pd0_dl1 = Conv1d(
194+
in_channels=3,
195+
out_channels=3,
196+
kernel_size=7,
197+
stride=1,
198+
padding=0,
199+
dilation=1,
200+
length=15,
201+
batches=1,
202+
)
203+
conv1d_5_1x3x14_st5_pd0_dl1 = Conv1d(
204+
in_channels=3,
205+
out_channels=3,
206+
kernel_size=5,
207+
stride=5,
208+
padding=0,
209+
dilation=1,
210+
length=14,
211+
batches=1,
212+
)
213+
conv1d_5_1x3x9_st5_pd0_dl1 = Conv1d(
214+
in_channels=3,
215+
out_channels=3,
216+
kernel_size=5,
217+
stride=5,
218+
padding=0,
219+
dilation=1,
220+
length=9,
221+
batches=1,
222+
)
223+
183224
two_conv1d_nobias = Conv1d(
184225
nbr_conv=2,
185226
length=256,
@@ -214,6 +255,10 @@ def forward(self, x):
214255
("2_1x2x14_st2", conv1d_2_1x2x14_st2),
215256
("5_3x2x128_st1", conv1d_5_3x2x128_st1),
216257
("3_1x3x224_st2_pd1", conv1d_3_1x3x224_st2_pd1),
258+
("7_1x3x16_st2_pd1_dl2_needs_adjust_pass", conv1d_7_1x3x16_st2_pd1_dl2),
259+
("7_1x3x15_st1_pd0_dl1_needs_adjust_pass", conv1d_7_1x3x15_st1_pd0_dl1),
260+
("5_1x3x14_st5_pd0_dl1_needs_adjust_pass", conv1d_5_1x3x14_st5_pd0_dl1),
261+
("5_1x3x9_st5_pd0_dl1_needs_adjust_pass", conv1d_5_1x3x9_st5_pd0_dl1),
217262
("two_conv1d_nobias", two_conv1d_nobias),
218263
("two_conv1d", two_conv1d),
219264
]

backends/arm/test/ops/test_conv2d.py

Lines changed: 105 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Arm Limited and/or its affiliates.
1+
# Copyright 2024-2025 Arm Limited and/or its affiliates.
22
# All rights reserved.
33
#
44
# This source code is licensed under the BSD-style license found in the
@@ -201,6 +201,101 @@ def forward(self, x):
201201
batches=1,
202202
)
203203

204+
conv2d_7x7_1x3x16x16_st2_pd1_dl2 = Conv2d(
205+
in_channels=3,
206+
out_channels=3,
207+
kernel_size=(7, 7),
208+
stride=2,
209+
padding=1,
210+
dilation=2,
211+
width=16,
212+
height=16,
213+
batches=1,
214+
)
215+
216+
conv2d_7x7_1x3x15x15_st1_pd0_dl1 = Conv2d(
217+
in_channels=3,
218+
out_channels=3,
219+
kernel_size=(7, 7),
220+
stride=1,
221+
padding=0,
222+
dilation=1,
223+
width=15,
224+
height=15,
225+
batches=1,
226+
)
227+
228+
conv2d_5x5_1x3x14x14_st5_pd0_dl1 = Conv2d(
229+
in_channels=3,
230+
out_channels=3,
231+
kernel_size=(5, 5),
232+
stride=5,
233+
padding=0,
234+
dilation=1,
235+
width=14,
236+
height=14,
237+
batches=1,
238+
)
239+
240+
conv2d_5x5_1x3x9x9_st5_pd0_dl1 = Conv2d(
241+
in_channels=3,
242+
out_channels=3,
243+
kernel_size=(5, 5),
244+
stride=5,
245+
padding=0,
246+
dilation=1,
247+
width=9,
248+
height=9,
249+
batches=1,
250+
)
251+
252+
conv2d_3x3_1x3x8x9_st3_pd0_dl1 = Conv2d(
253+
in_channels=3,
254+
out_channels=3,
255+
kernel_size=(3, 3),
256+
stride=3,
257+
padding=0,
258+
dilation=1,
259+
width=8,
260+
height=9,
261+
batches=1,
262+
)
263+
264+
conv2d_3x3_1x3x9x8_st3_pd0_dl1 = Conv2d(
265+
in_channels=3,
266+
out_channels=3,
267+
kernel_size=(3, 3),
268+
stride=3,
269+
padding=0,
270+
dilation=1,
271+
width=8,
272+
height=9,
273+
batches=1,
274+
)
275+
276+
conv2d_3x4_1x3x7x7_st3_pd0_dl1 = Conv2d(
277+
in_channels=3,
278+
out_channels=3,
279+
kernel_size=(3, 4),
280+
stride=3,
281+
padding=0,
282+
dilation=1,
283+
width=7,
284+
height=7,
285+
batches=1,
286+
)
287+
288+
conv2d_4x3_1x3x7x7_st3_pd0_dl1 = Conv2d(
289+
in_channels=3,
290+
out_channels=3,
291+
kernel_size=(4, 3),
292+
stride=3,
293+
padding=0,
294+
dilation=1,
295+
width=7,
296+
height=7,
297+
batches=1,
298+
)
204299

205300
two_conv2d_nobias = Conv2d(
206301
nbr_conv=2,
@@ -236,7 +331,15 @@ def forward(self, x):
236331
("3x3_1x3x12x12_st2_pd1", conv2d_3x3_1x3x12x12_st2_pd1),
237332
("1x1_1x2x128x128_st1", conv2d_1x1_1x2x128x128_st1),
238333
("2x2_1x1x14x13_st2_needs_adjust_pass", conv2d_2x2_1x1x14x13_st2),
239-
("conv2d_5x5_1x3x14x15_st3_pd1_needs_adjust_pass", conv2d_5x5_1x3x14x15_st3_pd1),
334+
("5x5_1x3x14x15_st3_pd1_needs_adjust_pass", conv2d_5x5_1x3x14x15_st3_pd1),
335+
("7x7_1x3x16x16_st2_pd1_dl2_needs_adjust_pass", conv2d_7x7_1x3x16x16_st2_pd1_dl2),
336+
("7x7_1x3x15x15_st1_pd0_dl1_needs_adjust_pass", conv2d_7x7_1x3x15x15_st1_pd0_dl1),
337+
("5x5_1x3x14x14_st5_pd0_dl1_needs_adjust_pass", conv2d_5x5_1x3x14x14_st5_pd0_dl1),
338+
("5x5_1x3x9x9_st5_pd0_dl1_needs_adjust_pass", conv2d_5x5_1x3x9x9_st5_pd0_dl1),
339+
("3x3_1x3x9x8_st3_pd0_dl1_needs_adjust_pass", conv2d_3x3_1x3x9x8_st3_pd0_dl1),
340+
("3x3_1x3x8x9_st3_pd0_dl1_needs_adjust_pass", conv2d_3x3_1x3x8x9_st3_pd0_dl1),
341+
("3x4_1x3x7x7_st3_pd0_dl1_needs_adjust_pass", conv2d_3x4_1x3x7x7_st3_pd0_dl1),
342+
("4x3_1x3x7x7_st3_pd0_dl1_needs_adjust_pass", conv2d_4x3_1x3x7x7_st3_pd0_dl1),
240343
("5x5_3x2x128x128_st1", conv2d_5x5_3x2x128x128_st1),
241344
("3x3_1x3x224x224_st2_pd1", conv2d_3x3_1x3x224x224_st2_pd1),
242345
("two_conv2d_nobias", two_conv2d_nobias),

0 commit comments

Comments
 (0)