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):
5959 transforms .Scale (osize ),
6060 transforms .ToTensor (),
6161 ])(img )
62- # print img.size()
63- # print 'output size:', osize
64- # print result.size()
6562 assert osize in result .size ()
6663 if height < width :
6764 assert result .size (1 ) <= result .size (2 )
6865 elif width < height :
6966 assert result .size (1 ) >= result .size (2 )
7067
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+
7177 oheight = random .randint (5 , 12 ) * 2
7278 owidth = random .randint (5 , 12 ) * 2
7379 result = transforms .Compose ([
You can’t perform that action at this time.
0 commit comments