Commit d3e78103 authored by Alykhan Tejani's avatar Alykhan Tejani Committed by Francisco Massa
Browse files

add test when crop size == img size (#291)

parent 56b973b5
......@@ -190,6 +190,15 @@ class Tester(unittest.TestCase):
assert result.size(1) == oheight
assert result.size(2) == owidth
result = transforms.Compose([
transforms.ToPILImage(),
transforms.RandomCrop((height, width)),
transforms.ToTensor()
])(img)
assert result.size(1) == height
assert result.size(2) == width
assert np.allclose(img.numpy(), result.numpy())
def test_pad(self):
height = random.randint(10, 32) * 2
width = random.randint(10, 32) * 2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment