@@ -297,7 +297,8 @@ class Resize(torch.nn.Module):
297
297
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
298
298
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` and
299
299
``InterpolationMode.BICUBIC`` are supported.
300
- For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still acceptable.
300
+ For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
301
+ but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
301
302
max_size (int, optional): The maximum allowed for the longer edge of
302
303
the resized image: if the longer edge of the image is greater
303
304
than ``max_size`` after being resized according to ``size``, then
@@ -329,8 +330,8 @@ def __init__(self, size, interpolation=InterpolationMode.BILINEAR, max_size=None
329
330
# Backward compatibility with integer value
330
331
if isinstance (interpolation , int ):
331
332
warnings .warn (
332
- "Argument interpolation should be of type InterpolationMode instead of int . "
333
- "Please, use InterpolationMode enum."
333
+ "Argument ' interpolation' of type int is deprecated since 0.13 and will be removed in 0.15 . "
334
+ "Please use InterpolationMode enum."
334
335
)
335
336
interpolation = _interpolation_modes_from_int (interpolation )
336
337
@@ -754,7 +755,8 @@ class RandomPerspective(torch.nn.Module):
754
755
interpolation (InterpolationMode): Desired interpolation enum defined by
755
756
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
756
757
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
757
- For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still acceptable.
758
+ For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
759
+ but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
758
760
fill (sequence or number): Pixel fill value for the area outside the transformed
759
761
image. Default is ``0``. If given a number, the value is used for all bands respectively.
760
762
"""
@@ -767,8 +769,8 @@ def __init__(self, distortion_scale=0.5, p=0.5, interpolation=InterpolationMode.
767
769
# Backward compatibility with integer value
768
770
if isinstance (interpolation , int ):
769
771
warnings .warn (
770
- "Argument interpolation should be of type InterpolationMode instead of int . "
771
- "Please, use InterpolationMode enum."
772
+ "Argument ' interpolation' of type int is deprecated since 0.13 and will be removed in 0.15 . "
773
+ "Please use InterpolationMode enum."
772
774
)
773
775
interpolation = _interpolation_modes_from_int (interpolation )
774
776
@@ -868,8 +870,8 @@ class RandomResizedCrop(torch.nn.Module):
868
870
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
869
871
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` and
870
872
``InterpolationMode.BICUBIC`` are supported.
871
- For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still acceptable.
872
-
873
+ For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
874
+ but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
873
875
"""
874
876
875
877
def __init__ (self , size , scale = (0.08 , 1.0 ), ratio = (3.0 / 4.0 , 4.0 / 3.0 ), interpolation = InterpolationMode .BILINEAR ):
@@ -887,8 +889,8 @@ def __init__(self, size, scale=(0.08, 1.0), ratio=(3.0 / 4.0, 4.0 / 3.0), interp
887
889
# Backward compatibility with integer value
888
890
if isinstance (interpolation , int ):
889
891
warnings .warn (
890
- "Argument interpolation should be of type InterpolationMode instead of int . "
891
- "Please, use InterpolationMode enum."
892
+ "Argument ' interpolation' of type int is deprecated since 0.13 and will be removed in 0.15 . "
893
+ "Please use InterpolationMode enum."
892
894
)
893
895
interpolation = _interpolation_modes_from_int (interpolation )
894
896
@@ -1267,7 +1269,8 @@ class RandomRotation(torch.nn.Module):
1267
1269
interpolation (InterpolationMode): Desired interpolation enum defined by
1268
1270
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.NEAREST``.
1269
1271
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
1270
- For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still acceptable.
1272
+ For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
1273
+ but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
1271
1274
expand (bool, optional): Optional expansion flag.
1272
1275
If true, expands the output to make it large enough to hold the entire rotated image.
1273
1276
If false or omitted, make the output image the same size as the input image.
@@ -1300,8 +1303,8 @@ def __init__(
1300
1303
# Backward compatibility with integer value
1301
1304
if isinstance (interpolation , int ):
1302
1305
warnings .warn (
1303
- "Argument interpolation should be of type InterpolationMode instead of int . "
1304
- "Please, use InterpolationMode enum."
1306
+ "Argument ' interpolation' of type int is deprecated since 0.13 and will be removed in 0.15 . "
1307
+ "Please use InterpolationMode enum."
1305
1308
)
1306
1309
interpolation = _interpolation_modes_from_int (interpolation )
1307
1310
@@ -1388,7 +1391,8 @@ class RandomAffine(torch.nn.Module):
1388
1391
interpolation (InterpolationMode): Desired interpolation enum defined by
1389
1392
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.NEAREST``.
1390
1393
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
1391
- For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still acceptable.
1394
+ For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
1395
+ but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
1392
1396
fill (sequence or number): Pixel fill value for the area outside the transformed
1393
1397
image. Default is ``0``. If given a number, the value is used for all bands respectively.
1394
1398
fillcolor (sequence or number, optional):
@@ -1429,8 +1433,8 @@ def __init__(
1429
1433
# Backward compatibility with integer value
1430
1434
if isinstance (interpolation , int ):
1431
1435
warnings .warn (
1432
- "Argument interpolation should be of type InterpolationMode instead of int . "
1433
- "Please, use InterpolationMode enum."
1436
+ "Argument ' interpolation' of type int is deprecated since 0.13 and will be removed in 0.15 . "
1437
+ "Please use InterpolationMode enum."
1434
1438
)
1435
1439
interpolation = _interpolation_modes_from_int (interpolation )
1436
1440
@@ -1727,9 +1731,7 @@ def forward(self, img):
1727
1731
1728
1732
# cast self.value to script acceptable type
1729
1733
if isinstance (self .value , (int , float )):
1730
- value = [
1731
- self .value ,
1732
- ]
1734
+ value = [self .value ]
1733
1735
elif isinstance (self .value , str ):
1734
1736
value = None
1735
1737
elif isinstance (self .value , tuple ):
0 commit comments