Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
shijianjian committed Aug 22, 2024
1 parent 02d0dd0 commit ed2d11f
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions tests/augmentation/test_augmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5140,25 +5140,13 @@ def test_gradcheck(self, device):
class TestRandomDissolving(BaseTester):
torch.manual_seed(0) # for random reproductibility

def test_smoke(self):
images = torch.rand(2, 3, 16, 16)
aug = RandomDissolving(p=1.0, cache_dir="weights/")
images_aug = aug(images)
assert images_aug.shape == images.shape

def test_same_on_batch(self, device, dtype):
images = torch.rand(1, 3, 16, 16).repeat(2, 1, 1, 1)
aug = RandomDissolving(p=1.0, same_on_batch=True, cache_dir="weights/")
images_aug = aug(images)
self.assert_close(images_aug[0], images_aug[1])

def test_single_jpeg_quality(self, device, dtype):
def test_batch_proc(self, device, dtype):
images = torch.rand(4, 3, 16, 16)
aug = RandomDissolving(p=1.0, cache_dir="weights/")
images_aug = aug(images)
assert images_aug.shape == images.shape

def test_single_image(self, device, dtype):
def test_single_proc(self, device, dtype):
images = torch.rand(3, 16, 16)
aug = RandomDissolving(p=1.0, keepdim=True, cache_dir="weights/")
images_aug = aug(images)
Expand Down

0 comments on commit ed2d11f

Please sign in to comment.