From d7aea4336e092e09ec2f9c931a01667e56b6fc2c Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Thu, 28 Oct 2021 12:42:41 +0100 Subject: [PATCH] make sure random angle is high enough to see a difference --- test/test_transforms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_transforms.py b/test/test_transforms.py index 6a32a783d67..e4fb7574d22 100644 --- a/test/test_transforms.py +++ b/test/test_transforms.py @@ -1364,7 +1364,7 @@ def test_to_grayscale(): @pytest.mark.parametrize("p", (0, 1)) def test_random_apply(p, seed): torch.manual_seed(seed) - random_apply_transform = transforms.RandomApply([transforms.RandomRotation((1, 45))], p=p) + random_apply_transform = transforms.RandomApply([transforms.RandomRotation((45, 50))], p=p) img = transforms.ToPILImage()(torch.rand(3, 30, 40)) out = random_apply_transform(img) if p == 0: @@ -1384,7 +1384,7 @@ def test_random_choice(proba_passthrough, seed): random_choice_transform = transforms.RandomChoice( [ lambda x: x, # passthrough - transforms.RandomRotation((1, 45)), + transforms.RandomRotation((45, 50)), ], p=[proba_passthrough, 1 - proba_passthrough], )