66import torch
77from torchvision .transforms .functional import InterpolationMode
88
9- from ._datapoint import Datapoint , FillTypeJIT
9+ from ._datapoint import _FillTypeJIT , Datapoint
1010
1111
1212class Image (Datapoint ):
@@ -116,7 +116,7 @@ def rotate(
116116 interpolation : Union [InterpolationMode , int ] = InterpolationMode .NEAREST ,
117117 expand : bool = False ,
118118 center : Optional [List [float ]] = None ,
119- fill : FillTypeJIT = None ,
119+ fill : _FillTypeJIT = None ,
120120 ) -> Image :
121121 output = self ._F .rotate_image_tensor (
122122 self .as_subclass (torch .Tensor ), angle , interpolation = interpolation , expand = expand , fill = fill , center = center
@@ -130,7 +130,7 @@ def affine(
130130 scale : float ,
131131 shear : List [float ],
132132 interpolation : Union [InterpolationMode , int ] = InterpolationMode .NEAREST ,
133- fill : FillTypeJIT = None ,
133+ fill : _FillTypeJIT = None ,
134134 center : Optional [List [float ]] = None ,
135135 ) -> Image :
136136 output = self ._F .affine_image_tensor (
@@ -150,7 +150,7 @@ def perspective(
150150 startpoints : Optional [List [List [int ]]],
151151 endpoints : Optional [List [List [int ]]],
152152 interpolation : Union [InterpolationMode , int ] = InterpolationMode .BILINEAR ,
153- fill : FillTypeJIT = None ,
153+ fill : _FillTypeJIT = None ,
154154 coefficients : Optional [List [float ]] = None ,
155155 ) -> Image :
156156 output = self ._F .perspective_image_tensor (
@@ -167,7 +167,7 @@ def elastic(
167167 self ,
168168 displacement : torch .Tensor ,
169169 interpolation : Union [InterpolationMode , int ] = InterpolationMode .BILINEAR ,
170- fill : FillTypeJIT = None ,
170+ fill : _FillTypeJIT = None ,
171171 ) -> Image :
172172 output = self ._F .elastic_image_tensor (
173173 self .as_subclass (torch .Tensor ), displacement , interpolation = interpolation , fill = fill
@@ -241,7 +241,7 @@ def normalize(self, mean: List[float], std: List[float], inplace: bool = False)
241241 return Image .wrap_like (self , output )
242242
243243
244- ImageType = Union [torch .Tensor , PIL .Image .Image , Image ]
245- ImageTypeJIT = torch .Tensor
246- TensorImageType = Union [torch .Tensor , Image ]
247- TensorImageTypeJIT = torch .Tensor
244+ _ImageType = Union [torch .Tensor , PIL .Image .Image , Image ]
245+ _ImageTypeJIT = torch .Tensor
246+ _TensorImageType = Union [torch .Tensor , Image ]
247+ _TensorImageTypeJIT = torch .Tensor
0 commit comments