Skip to content

Commit

Permalink
avoid 0 degree rotation just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug committed Oct 27, 2021
1 parent accbc74 commit 84ed356
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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((-45, 45))], p=p)
random_apply_transform = transforms.RandomApply([transforms.RandomRotation((1, 45))], p=p)
img = transforms.ToPILImage()(torch.rand(3, 30, 40))
out = random_apply_transform(img)
if p == 0:
Expand All @@ -1384,7 +1384,7 @@ def test_random_choice(proba_passthrough, seed):
random_choice_transform = transforms.RandomChoice(
[
lambda x: x, # passthrough
transforms.RandomRotation((-45, 45)),
transforms.RandomRotation((1, 45)),
],
p=[proba_passthrough, 1 - proba_passthrough],
)
Expand Down

0 comments on commit 84ed356

Please sign in to comment.