File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -59,15 +59,21 @@ def test_scale(self):
59
59
transforms .Scale (osize ),
60
60
transforms .ToTensor (),
61
61
])(img )
62
- # print img.size()
63
- # print 'output size:', osize
64
- # print result.size()
65
62
assert osize in result .size ()
66
63
if height < width :
67
64
assert result .size (1 ) <= result .size (2 )
68
65
elif width < height :
69
66
assert result .size (1 ) >= result .size (2 )
70
67
68
+ result = transforms .Compose ([
69
+ transforms .ToPILImage (),
70
+ transforms .Scale ([osize , osize ]),
71
+ transforms .ToTensor (),
72
+ ])(img )
73
+ assert osize in result .size ()
74
+ assert result .size (1 ) == osize
75
+ assert result .size (2 ) == osize
76
+
71
77
oheight = random .randint (5 , 12 ) * 2
72
78
owidth = random .randint (5 , 12 ) * 2
73
79
result = transforms .Compose ([
You can’t perform that action at this time.
0 commit comments