class_docstr: Module to convert a RGB image to grayscale version of image.
  
  The image data is assumed to be in the range of (0, 1).
  
  Shape:
      - image: :math:`(*, 3, H, W)`
      - output: :math:`(*, 1, H, W)`
  
  reference:
      https://docs.opencv.org/4.0.1/de/d25/imgproc_color_conversions.html
  
  Example:
      >>> input = torch.rand(2, 3, 4, 5)
      >>> gray = RgbToGrayscale()
      >>> output = gray(input)  # 2x1x4x5
class_docstr_tok: ["Module","to","convert","a","RGB","image","to","grayscale","version","of","image",".","The","image","data","is","assumed","to","be","in","the","range","of","(","0",",","1",")",".","Shape",":","-","image",":",":","math",":","`","(","*",",","3",",","H",",","W",")","`","-","output",":",":","math",":","`","(","*",",","1",",","H",",","W",")","`","reference",":","https",":","\/\/docs.opencv.org\/4.0.1\/de\/d25\/imgproc_color_conversions.html","Example",":",">",">",">","input","=","torch.rand","(","2",",","3",",","4",",","5",")",">",">",">","gray","=","RgbToGrayscale","(",")",">",">",">","output","=","gray","(","input",")","#","2x1x4x5"]
code: def forward(self, image: Tensor) -> Tensor:
      return rgb_to_grayscale(image, rgb_weights=self.rgb_weights)
  
file_path: kornia/kornia/color/gray.py
imports: from __future__ import annotations
  from typing import Optional
  import torch
  from kornia.color.rgb import bgr_to_rgb
  from kornia.core import Module, Tensor, concatenate
  from kornia.core.check import KORNIA_CHECK_IS_TENSOR
label_desc: Use image node_id 2 for calling the RgbToGrayscale obj's underlying member method code with example usage: obj.forward(image) and returns: rgb_to_grayscale