code: def grayscale(images):
      """
      Get the grayscale for the input images. The channels of images should be
      in order BGR.
      Args:
          images (tensor): the input images for getting grayscale. Dimension is
              `num frames` x `channel` x `height` x `width`.
      Returns:
          img_gray (tensor): blended images, the dimension is
              `num frames` x `channel` x `height` x `width`.
      """
      # R -> 0.299, G -> 0.587, B -> 0.114.
      img_gray = torch.tensor(images)
      gray_channel = (
          0.299 * images[:, 2]
          + 0.587 * images[:, 1]
          + 0.114 * images[:, 0]
      )
      img_gray[:, 0] = gray_channel
      img_gray[:, 1] = gray_channel
      img_gray[:, 2] = gray_channel
      return img_gray
  
imports: import logging
  import math
  import numpy
  import random
  import torch
  import torchvision
  import torchvision.transforms.functional
  from PIL import Image, ImageFilter
  from scipy.ndimage import gaussian_filter
  from torchvision import transforms
  from .rand_augment import rand_augment_transform
  from .random_erasing import RandomErasing
label_desc: Use image node_id 9 for calling a global function with example usage: grayscale(images) and returns: img_gray