@@ -474,6 +474,7 @@ def test_boxes_shape(self):
474
474
@pytest .mark .parametrize ("x_dtype" , (torch .float16 , torch .float32 , torch .float64 )) # , ids=str)
475
475
@pytest .mark .parametrize ("contiguous" , (True , False ))
476
476
@pytest .mark .parametrize ("deterministic" , (True , False ))
477
+ @pytest .mark .opcheck_only_one ()
477
478
def test_forward (self , device , contiguous , deterministic , aligned , x_dtype , rois_dtype = None ):
478
479
if deterministic and device == "cpu" :
479
480
pytest .skip ("cpu is always deterministic, don't retest" )
@@ -491,6 +492,7 @@ def test_forward(self, device, contiguous, deterministic, aligned, x_dtype, rois
491
492
@pytest .mark .parametrize ("deterministic" , (True , False ))
492
493
@pytest .mark .parametrize ("x_dtype" , (torch .float , torch .half ))
493
494
@pytest .mark .parametrize ("rois_dtype" , (torch .float , torch .half ))
495
+ @pytest .mark .opcheck_only_one ()
494
496
def test_autocast (self , aligned , deterministic , x_dtype , rois_dtype ):
495
497
with torch .cuda .amp .autocast ():
496
498
self .test_forward (
@@ -506,6 +508,7 @@ def test_autocast(self, aligned, deterministic, x_dtype, rois_dtype):
506
508
@pytest .mark .parametrize ("device" , cpu_and_cuda_and_mps ())
507
509
@pytest .mark .parametrize ("contiguous" , (True , False ))
508
510
@pytest .mark .parametrize ("deterministic" , (True , False ))
511
+ @pytest .mark .opcheck_only_one ()
509
512
def test_backward (self , seed , device , contiguous , deterministic ):
510
513
if deterministic and device == "cpu" :
511
514
pytest .skip ("cpu is always deterministic, don't retest" )
@@ -520,6 +523,7 @@ def _make_rois(self, img_size, num_imgs, dtype, num_rois=1000):
520
523
@pytest .mark .parametrize ("aligned" , (True , False ))
521
524
@pytest .mark .parametrize ("scale, zero_point" , ((1 , 0 ), (2 , 10 ), (0.1 , 50 )))
522
525
@pytest .mark .parametrize ("qdtype" , (torch .qint8 , torch .quint8 , torch .qint32 ))
526
+ @pytest .mark .opcheck_only_one ()
523
527
def test_qroialign (self , aligned , scale , zero_point , qdtype ):
524
528
"""Make sure quantized version of RoIAlign is close to float version"""
525
529
pool_size = 5
@@ -589,6 +593,15 @@ def test_jit_boxes_list(self):
589
593
self ._helper_jit_boxes_list (model )
590
594
591
595
596
+ optests .generate_opcheck_tests (
597
+ testcase = TestRoIAlign ,
598
+ namespaces = ["torchvision" ],
599
+ failures_dict_path = os .path .join (os .path .dirname (__file__ ), "optests_failures_dict.json" ),
600
+ additional_decorators = [],
601
+ test_utils = OPTESTS ,
602
+ )
603
+
604
+
592
605
class TestPSRoIAlign (RoIOpTester ):
593
606
mps_backward_atol = 5e-2
594
607
0 commit comments