class_docstr: Convert images or videos to grayscale.
  
  If the input is a :class:`torch.Tensor`, it is expected
  to have [..., 3 or 1, H, W] shape, where ... means an arbitrary number of leading dimensions
  
  Args:
      num_output_channels (int): (1 or 3) number of channels desired for output image
class_docstr_tok: ["Convert","images","or","videos","to","grayscale",".","If","the","input","is","a",":","class",":","`","torch.Tensor","`",",","it","is","expected","to","have","[","...",",","3","or","1",",","H",",","W","]","shape",",","where","...","means","an","arbitrary","number","of","leading","dimensions","Args",":","num_output_channels","(","int",")",":","(","1","or","3",")","number","of","channels","desired","for","output","image"]
code: def _transform(self, inpt: Any, params: Dict[str, Any]) -> Any:
      return self._call_kernel(
          F.rgb_to_grayscale,
          inpt,
          num_output_channels=self.num_output_channels,
      )
  
imports: import collections.abc
  from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
  import torch
  from torchvision import transforms
  from torchvision.transforms.v2 import functional, Transform
  from ._transform import _RandomApplyTransform
  from ._utils import query_chw
label_desc: Use image node_id 2 for calling the Grayscale obj's underlying member method code with example usage: obj._transform(inpt, params) and returns: self