code: def perspective(
      img: Tensor,
      perspective_coeffs: List[float],
      interpolation: str = "bilinear",
      fill: Optional[Union[int, float, List[float]]] = None,
  ) -> Tensor:
      if not (isinstance(img, torch.Tensor)):
          raise TypeError("Input img should be Tensor.")
  
      _assert_image_tensor(img)
  
      _assert_grid_transform_inputs(
          img,
          matrix=None,
          interpolation=interpolation,
          fill=fill,
          supported_interpolation_modes=["nearest", "bilinear"],
          coeffs=perspective_coeffs,
      )
  
      ow, oh = img.shape[-1], img.shape[-2]
      dtype = (
          img.dtype if torch.is_floating_point(img) else torch.float32
      )
      grid = _perspective_grid(
          perspective_coeffs,
          ow=ow,
          oh=oh,
          dtype=dtype,
          device=img.device,
      )
      return _apply_grid_transform(img, grid, interpolation, fill=fill)
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn.functional import conv2d, grid_sample, interpolate, pad
label_desc: Use image node_id 34 for calling a global function with example usage: perspective(img, perspective_coeffs, interpolation, fill) and returns: _apply_grid_transform