Skip to content

Commit e00d818

Browse files
authored
Set seed of test_random_erasing (#4764)
* Trying with 100 seeds * Change seeds from 100 to 10
1 parent 3a17e33 commit e00d818

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/test_transforms.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1750,8 +1750,10 @@ def test_color_jitter():
17501750
color_jitter.__repr__()
17511751

17521752

1753+
@pytest.mark.parametrize("seed", range(10))
17531754
@pytest.mark.skipif(stats is None, reason="scipy.stats not available")
1754-
def test_random_erasing():
1755+
def test_random_erasing(seed):
1756+
torch.random.manual_seed(seed)
17551757
img = torch.ones(3, 128, 128)
17561758

17571759
t = transforms.RandomErasing(scale=(0.1, 0.1), ratio=(1 / 3, 3.0))

0 commit comments

Comments
 (0)