Commit 323f5294 authored by Soumith Chintala's avatar Soumith Chintala
Browse files

add test for Scale size list

parent efd1bfe5
......@@ -59,15 +59,21 @@ class Tester(unittest.TestCase):
transforms.Scale(osize),
transforms.ToTensor(),
])(img)
# print img.size()
# print 'output size:', osize
# print result.size()
assert osize in result.size()
if height < width:
assert result.size(1) <= result.size(2)
elif width < height:
assert result.size(1) >= result.size(2)
result = transforms.Compose([
transforms.ToPILImage(),
transforms.Scale([osize, osize]),
transforms.ToTensor(),
])(img)
assert osize in result.size()
assert result.size(1) == osize
assert result.size(2) == osize
oheight = random.randint(5, 12) * 2
owidth = random.randint(5, 12) * 2
result = transforms.Compose([
......
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