@@ -294,6 +294,51 @@ def test_add_tensor_vgf_quant_a16w8(test_data: input_t1):
294294 pipeline .run ()
295295
296296
297+ class AddConvResidual (torch .nn .Module ):
298+ """Conv(x) + x — residual block.
299+
300+ Creates non-unit IFM scales
301+
302+ """
303+
304+ def __init__ (self ):
305+ super ().__init__ ()
306+ self .conv = torch .nn .Conv2d (3 , 3 , 1 , bias = False )
307+
308+ def forward (self , x ):
309+ return self .conv (x ) + x
310+
311+ test_data = {
312+ "4d_randn" : lambda : (torch .randn (1 , 3 , 4 , 4 ),),
313+ }
314+
315+
316+ @common .parametrize ("test_data" , AddConvResidual .test_data )
317+ def test_add_conv_residual_tosa_INT (test_data : input_t1 ):
318+ pipeline = TosaPipelineINT [input_t1 ](
319+ AddConvResidual (), test_data (), aten_op , exir_op
320+ )
321+ pipeline .run ()
322+
323+
324+ @common .parametrize ("test_data" , AddConvResidual .test_data )
325+ @common .XfailIfNoCorstone300
326+ def test_add_conv_residual_u55_INT (test_data : input_t1 ):
327+ pipeline = EthosU55PipelineINT [input_t1 ](
328+ AddConvResidual (), test_data (), aten_op , exir_op
329+ )
330+ pipeline .run ()
331+
332+
333+ @common .parametrize ("test_data" , AddConvResidual .test_data )
334+ @common .XfailIfNoCorstone320
335+ def test_add_conv_residual_u85_INT (test_data : input_t1 ):
336+ pipeline = EthosU85PipelineINT [input_t1 ](
337+ AddConvResidual (), test_data (), aten_op , exir_op
338+ )
339+ pipeline .run ()
340+
341+
297342@common .parametrize ("test_data" , Add .test_data )
298343def test_add_tensor_tosa_INT_16a8w (test_data : input_t1 ):
299344 """Test add operation with 16A8W quantization (16-bit activations, 8-bit
0 commit comments