code: def rgb_to_yuv_ccir(img):
      """rgb to yuv conversion ported from ffmpeg
  
      The input image is expected to be (..., channel, height, width).
      """
      assert img.dtype == torch.uint8
      img = img.to(torch.float32)
  
      r, g, b = torch.split(img, 1, dim=-3)
  
      # https://github.com/FFmpeg/FFmpeg/blob/870bfe16a12bf09dca3a4ae27ef6f81a2de80c40/libavutil/colorspace.h#L98
      y = 263 * r + 516 * g + 100 * b + 512 + 16384
      y /= 1024
  
      # https://github.com/FFmpeg/FFmpeg/blob/870bfe16a12bf09dca3a4ae27ef6f81a2de80c40/libavutil/colorspace.h#L102
      # shift == 0
      u = -152 * r - 298 * g + 450 * b + 512 - 1
      u /= 1024
      u += 128
  
      # https://github.com/FFmpeg/FFmpeg/blob/870bfe16a12bf09dca3a4ae27ef6f81a2de80c40/libavutil/colorspace.h#L106
      # shift == 0
      v = 450 * r - 377 * g - 73 * b + 512 - 1
      v /= 1024
      v += 128
  
      return torch.cat([y, u, v], -3).to(torch.uint8)
  
imports: import torch
  from torchaudio._internal.module_utils import is_module_available
label_desc: Use image node_id 3 for calling a global function with example usage: rgb_to_yuv_ccir(img) and returns: torch