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 1010
1111@torch .jit .unused
1212def 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)"
1713 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 `." ,
2016 )
21-
2217 return _F .to_grayscale (inpt , num_output_channels = num_output_channels )
2318
2419
You can’t perform that action at this time.
0 commit comments