@@ -313,6 +313,47 @@ def test_sub_tensor_vgf_quant_2(test_data: Tuple[torch.Tensor, torch.Tensor]):
313313 pipeline .run ()
314314
315315
316+ class SubConvResidual (torch .nn .Module ):
317+ """conv(x) - x — residual block. Creates non-unit IFM scales"""
318+
319+ def __init__ (self ):
320+ super ().__init__ ()
321+ self .conv = torch .nn .Conv2d (3 , 3 , 1 , bias = False )
322+
323+ def forward (self , x ):
324+ return self .conv (x ) - x
325+
326+ test_data = {
327+ "4d_randn" : lambda : (torch .randn (1 , 3 , 4 , 4 ),),
328+ }
329+
330+
331+ @common .parametrize ("test_data" , SubConvResidual .test_data )
332+ def test_sub_conv_residual_tosa_INT (test_data : input_t1 ):
333+ pipeline = TosaPipelineINT [input_t1 ](
334+ SubConvResidual (), test_data (), aten_op , exir_op
335+ )
336+ pipeline .run ()
337+
338+
339+ @common .parametrize ("test_data" , SubConvResidual .test_data )
340+ @common .XfailIfNoCorstone300
341+ def test_sub_conv_residual_u55_INT (test_data : input_t1 ):
342+ pipeline = EthosU55PipelineINT [input_t1 ](
343+ SubConvResidual (), test_data (), aten_op , exir_op
344+ )
345+ pipeline .run ()
346+
347+
348+ @common .parametrize ("test_data" , SubConvResidual .test_data )
349+ @common .XfailIfNoCorstone320
350+ def test_sub_conv_residual_u85_INT (test_data : input_t1 ):
351+ pipeline = EthosU85PipelineINT [input_t1 ](
352+ SubConvResidual (), test_data (), aten_op , exir_op
353+ )
354+ pipeline .run ()
355+
356+
316357@common .parametrize ("test_data" , sub_test_data )
317358def test_sub_tensor_16a8w_tosa_INT (test_data : input_t1 ):
318359 """Test sub operation with 16A8W quantization (16-bit activations, 8-bit
0 commit comments