File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
torchvision/transforms/v2/functional Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 10
10
11
11
@torch .jit .unused
12
12
def to_grayscale (inpt : PIL .Image .Image , num_output_channels : int = 1 ) -> PIL .Image .Image :
13
- call = ", num_output_channels=3" if num_output_channels == 3 else ""
14
- replacement = "convert_color_space(..., color_space=datapoints.ColorSpace.GRAY)"
15
- if num_output_channels == 3 :
16
- replacement = f"convert_color_space({ replacement } , color_space=datapoints.ColorSpace.RGB)"
17
13
warnings .warn (
18
- f "The function `to_grayscale(... { call } ) ` is deprecated in will be removed in a future release. "
19
- f "Instead, please use `{ replacement } `." ,
14
+ "The function `to_grayscale` is deprecated in will be removed in a future release. "
15
+ "Instead, please use `rgb_to_grayscale `." ,
20
16
)
21
-
22
17
return _F .to_grayscale (inpt , num_output_channels = num_output_channels )
23
18
24
19
You can’t perform that action at this time.
0 commit comments