Skip to content

Setting seeds for test_batched_nms_implementations #4766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Oct 28, 2021
4 changes: 3 additions & 1 deletion test/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,10 @@ def test_nms_cuda_float16(self):
keep16 = ops.nms(boxes.to(torch.float16), scores.to(torch.float16), iou_thres)
assert_equal(keep32, keep16)

def test_batched_nms_implementations(self):
@pytest.mark.parametrize("seed", range(10))
def test_batched_nms_implementations(self, seed):
"""Make sure that both implementations of batched_nms yield identical results"""
torch.random.manual_seed(seed)

num_boxes = 1000
iou_threshold = 0.9
Expand Down