Skip to content

Commit f5af07b

Browse files
authored
More robust test_random_apply and test_random_choice (#4775)
1 parent b47ea83 commit f5af07b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_transforms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ def test_to_grayscale():
13641364
@pytest.mark.parametrize("p", (0, 1))
13651365
def test_random_apply(p, seed):
13661366
torch.manual_seed(seed)
1367-
random_apply_transform = transforms.RandomApply([transforms.RandomRotation((1, 45))], p=p)
1367+
random_apply_transform = transforms.RandomApply([transforms.RandomRotation((45, 50))], p=p)
13681368
img = transforms.ToPILImage()(torch.rand(3, 30, 40))
13691369
out = random_apply_transform(img)
13701370
if p == 0:
@@ -1384,7 +1384,7 @@ def test_random_choice(proba_passthrough, seed):
13841384
random_choice_transform = transforms.RandomChoice(
13851385
[
13861386
lambda x: x, # passthrough
1387-
transforms.RandomRotation((1, 45)),
1387+
transforms.RandomRotation((45, 50)),
13881388
],
13891389
p=[proba_passthrough, 1 - proba_passthrough],
13901390
)

0 commit comments

Comments
 (0)