(self, img)
return F.rgb_to_grayscale(
            img, num_output_channels=self.num_output_channels)
Args:
            img (PIL Image or Tensor): Image to be converted to grayscale.

        Returns:
            PIL Image or Tensor: Grayscaled image.
Args:
            img (PIL Image or Tensor): Image to be converted to grayscale.
Args : img ( PIL Image or Tensor ) : Image to be converted to grayscale .
def forward(self, img):
        """
        Args:
            img (PIL Image or Tensor): Image to be converted to grayscale.

        Returns:
            PIL Image or Tensor: Grayscaled image.
        """
        return F.rgb_to_grayscale(
            img, num_output_channels=self.num_output_channels)
def forward ( self , img ) : return F . rgb_to_grayscale ( img , num_output_channels = self . num_output_channels )