code: def _assert_grid_transform_inputs(
      img: Tensor,
      matrix: Optional[List[float]],
      interpolation: str,
      fill: Optional[Union[int, float, List[float]]],
      supported_interpolation_modes: List[str],
      coeffs: Optional[List[float]] = None,
  ) -> None:
      def get_dimensions(img: Tensor) -> List[int]:
          channels = 1 if img.ndim == 2 else img.shape[-3]
          height, width = img.shape[-2:]
          return [channels, height, width]
  
      if not (isinstance(img, torch.Tensor)):
          raise TypeError("Input img should be Tensor")
  
      if matrix is not None and not isinstance(matrix, list):
          raise TypeError("Argument matrix should be a list")
  
      if matrix is not None and len(matrix) != 6:
          raise ValueError("Argument matrix should have 6 float values")
  
      if coeffs is not None and len(coeffs) != 8:
          raise ValueError("Argument coeffs should have 8 float values")
  
      # Check fill
      num_channels = get_dimensions(img)[0]
      if (
          fill is not None
          and isinstance(fill, (tuple, list))
          and len(fill) > 1
          and len(fill) != num_channels
      ):
          msg = (
              "The number of elements in 'fill' cannot broadcast to match the number of "
              "channels of the image ({} != {})"
          )
          raise ValueError(msg.format(len(fill), num_channels))
  
      if interpolation not in supported_interpolation_modes:
          raise ValueError(
              f"Interpolation mode '{interpolation}' is unsupported with Tensor input"
          )
  
imports: from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import torch
  import torchvision
  from torch import Tensor
  from torchvision.transforms.functional import InterpolationMode
label_desc: Use image node_id 21 for calling a global function with example usage: _assert_grid_transform_inputs(img, matrix, interpolation, fill, supported_interpolation_modes, coeffs) and returns: list