torchvision.transforms — Torchvision 0.8.1 documentation
pytorch.org › vision › 0torchvision.transforms.functional.rgb_to_grayscale (img: torch.Tensor, num_output_channels: int = 1) → torch.Tensor [source] ¶ Convert RGB image to grayscale version of image. The image can be a PIL Image or a Tensor, in which case it is expected to have […, H, W] shape, where … means an arbitrary number of leading dimensions