Skip to content

Commit bddc464

Browse files
prabhat00155facebook-github-bot
authored andcommitted
[fbsync] More robust test_random_apply and test_random_choice (#4775)
Reviewed By: kazhang Differential Revision: D32216679 fbshipit-source-id: 49882628485d0749c60422266c4ad98707904420
1 parent 5d9242e commit bddc464

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)