@@ -63,16 +63,10 @@ def test_constant_pad_nd_conversion__default_constant():
6363 pytest .param ((2 , 4 ), tuple (range (4 )), id = "2D, padding N, H" ),
6464 pytest .param ((2 , 4 , 6 ), tuple (range (2 )), id = "3D, padding H" ),
6565 pytest .param ((2 , 4 , 6 ), tuple (range (4 )), id = "3D, padding C, H" ),
66- pytest .param ((2 , 4 , 6 ), list (range (6 )), id = "3D, padding N, C, H" ),
6766 pytest .param ((2 , 4 , 6 , 8 ), tuple (range (2 )), id = "4D, padding W" ),
6867 pytest .param ((2 , 4 , 6 , 8 ), tuple (range (4 )), id = "4D, padding H, W" ),
69- pytest .param ((2 , 4 , 6 , 8 ), list (range (6 )), id = "4D, padding C, H, W" ),
70- pytest .param ((2 , 4 , 6 , 8 ), list (range (8 )), id = "4D, padding N, C, H, W" ),
71- pytest .param ((1 , 2 , 3 , 4 , 5 ), list (range (2 )), id = "5D, padding D" ),
68+ pytest .param ((1 , 2 , 3 , 4 , 5 ), tuple (range (2 )), id = "5D, padding D" ),
7269 pytest .param ((1 , 2 , 3 , 4 , 5 ), tuple (range (4 )), id = "5D, padding W, D" ),
73- pytest .param ((1 , 2 , 3 , 4 , 5 ), list (range (6 )), id = "5D, padding H, W, D" ),
74- pytest .param ((1 , 2 , 3 , 4 , 5 ), tuple (range (8 )), id = "5D, padding C, H, W, D" ),
75- pytest .param ((1 , 2 , 3 , 4 , 5 ), list (range (10 )), id = "5D, padding N, C, H, W, D" ),
7670 ],
7771)
7872def test_constant_pad_nd_conversion__format_less (input_shape , paddings ):
@@ -88,13 +82,16 @@ def test_constant_pad_nd_conversion__format_less(input_shape, paddings):
8882@pytest .mark .parametrize (
8983 "input_shape, paddings" ,
9084 [
91- pytest .param ((1 , 4 , 6 , 8 ), tuple (range (2 )), id = "4D, padding W" ),
92- pytest .param ((1 , 4 , 6 , 8 ), tuple (range (4 )), id = "4D, padding H, W" ),
85+ pytest .param ([1 , 4 , 6 , 8 ], list (range (2 )), id = "4D, padding W" ),
86+ pytest .param ([1 , 4 , 6 , 8 ], list (range (4 )), id = "4D, padding H, W" ),
87+ pytest .param ([1 , 1 , 6 , 8 ], [1 , 2 , 3 , 4 , 2 , 1 ], id = "4D, padding C, H, W" ),
88+ # pytest.param([1, 1, 6, 8], [1, 2, 3, 4, 2, 1, 5, 6], id='4D, padding N, C, H, W'), # Batch size must stay 0.
9389 ],
9490)
9591def test_constant_pad_nd_conversion__channels_first (input_shape , paddings ):
92+ model = ConstantPadNDConvModule (paddings )
9693 edge_program = to_edge_program (
97- ConstantPadNDConvModule ( paddings ) , input_shape
94+ model , input_shape
9895 ).exported_program () # Extra `Conv` after the padding.
9996
10097 input_data = np .random .random (input_shape ).astype (np .float32 )
0 commit comments