@@ -1488,12 +1488,15 @@ def test_distance_iou_loss(self, dtype, device):
14881488 def test_empty_distance_iou_inputs (self , dtype , device ):
14891489 assert_empty_loss (ops .distance_box_iou_loss , dtype , device )
14901490
1491+
14911492class TestLastLevelMaxPool2d :
14921493 def _generate_fpn_feature_maps (self , ** kwargs ) -> Tuple [List [Tensor ], List [str ]]:
1493- feature_maps = [torch .rand (16 , 3 , 240 , 320 ),
1494- torch .rand (16 , 3 , 120 , 160 ),
1495- torch .rand (16 , 3 , 60 , 80 ),
1496- torch .rand (16 , 3 , 30 , 40 )]
1494+ feature_maps = [
1495+ torch .rand (16 , 3 , 240 , 320 ),
1496+ torch .rand (16 , 3 , 120 , 160 ),
1497+ torch .rand (16 , 3 , 60 , 80 ),
1498+ torch .rand (16 , 3 , 30 , 40 )
1499+ ]
14971500 names = ['0' , '1' , '2' , '3' ]
14981501
14991502 return feature_maps , names
@@ -1511,6 +1514,7 @@ def test_lastlevel_maxpool2d(self) -> None:
15111514 tol = 1e-3 if feature_maps [- 1 ].dtype is torch .half else 1e-5
15121515 torch .testing .assert_close (expected_pooled_featuremap , results [- 1 ], atol = tol , rtol = tol )
15131516
1517+
15141518class TestFocalLoss :
15151519 def _generate_diverse_input_target_pair (self , shape = (5 , 2 ), ** kwargs ):
15161520 def logit (p ):
0 commit comments