@@ -290,3 +290,46 @@ def test_cat__force_delegate():
290290 graph = quantized_program .graph , ops = [exir_ops .edge .aten .cat .default ]
291291 )
292292 assert any ("lowered_module" in node .name for node in quantized_program .graph .nodes )
293+
294+
295+ def test_cat__same_shapes_converter_padding_last_dimension ():
296+ target = "imxrt700"
297+
298+ # The Converter is capable of padding the last dimension of `cat` with the same input shapes.
299+ input_shape = (3 , 1 , 3 )
300+
301+ quantized_program = to_quantized_edge_program (
302+ CatModule (2 ),
303+ [input_shape , input_shape ],
304+ target = target ,
305+ neutron_converter_flavor = "SDK_25_09" ,
306+ custom_delegation_options = CustomDelegationOptions (),
307+ ).exported_program ()
308+
309+ # Make sure the `Cat` was delegated.
310+ assert not graph_contains_any_of_ops (
311+ graph = quantized_program .graph , ops = [exir_ops .edge .aten .cat .default ]
312+ )
313+ assert any ("lowered_module" in node .name for node in quantized_program .graph .nodes )
314+
315+
316+ def test_cat__same_shapes_converter_padding_middle_dimension ():
317+ target = "imxrt700"
318+
319+ # The Converter is not capable of padding the middle dimensions of `cat` with the same input shapes.
320+ input_shape = (3 , 1 , 3 )
321+
322+ quantized_program = to_quantized_edge_program (
323+ CatModule (1 ),
324+ [input_shape , input_shape ],
325+ target = target ,
326+ custom_delegation_options = CustomDelegationOptions (),
327+ ).exported_program ()
328+
329+ # Make sure the `Cat` was NOT delegated.
330+ assert graph_contains_any_of_ops (
331+ graph = quantized_program .graph , ops = [exir_ops .edge .aten .cat .default ]
332+ )
333+ assert not any (
334+ "lowered_module" in node .name for node in quantized_program .graph .nodes
335+ )
0 commit comments