@@ -158,22 +158,16 @@ def test_tensor_gray_to_pil_image(self):
158158 img_data_byte = torch .ByteTensor (1 , 4 , 4 ).random_ (0 , 255 )
159159 img_data_short = torch .ShortTensor (1 , 4 , 4 ).random_ ()
160160 img_data_int = torch .IntTensor (1 , 4 , 4 ).random_ ()
161- img_data_float = torch .FloatTensor (1 , 4 , 4 ).uniform_ ()
162161
163162 img_byte = trans (img_data_byte )
164163 img_short = trans (img_data_short )
165164 img_int = trans (img_data_int )
166- img_float = trans (img_data_float )
167165 assert img_byte .mode == 'L'
168166 assert img_short .mode == 'I;16'
169167 assert img_int .mode == 'I'
170- #assert img_float.mode == 'F'
171168
172169 assert np .allclose (img_data_short .numpy (), to_tensor (img_short ).numpy ())
173170 assert np .allclose (img_data_int .numpy (), to_tensor (img_int ).numpy ())
174- # would cause breaking changes as ToTensor converts to range [0, 1]
175- #assert np.allclose(img_data_byte.numpy(), to_tensor(img_byte).numpy())
176- #assert np.allclose(img_data_float.numpy(), to_tensor(img_float).numpy())
177171
178172 def test_ndarray_to_pil_image (self ):
179173 trans = transforms .ToPILImage ()
0 commit comments