code: def resize(
      img: Tensor,
      size: List[int],
      interpolation: str = "bilinear",
      antialias: Optional[bool] = True,
  ) -> Tensor:
      _assert_image_tensor(img)
  
      if isinstance(size, tuple):
          size = list(size)
  
      if antialias is None:
          antialias = False
  
      if antialias and interpolation not in ["bilinear", "bicubic"]:
          # We manually set it to False to avoid an error downstream in interpolate()
          # This behaviour is documented: the parameter is irrelevant for modes
          # that are not bilinear or bicubic. We used to raise an error here, but
          # now we don't as True is the default.
          antialias = False
  
      img, need_cast, need_squeeze, out_dtype = _cast_squeeze_in(
          img, [torch.float32, torch.float64]
      )
  
      # Define align_corners to avoid warnings
      align_corners = (
          False if interpolation in ["bilinear", "bicubic"] else None
      )
  
      img = interpolate(
          img,
          size=size,
          mode=interpolation,
          align_corners=align_corners,
          antialias=antialias,
      )
  
      if interpolation == "bicubic" and out_dtype == torch.uint8:
          img = img.clamp(min=0, max=255)
  
      img = _cast_squeeze_out(
          img,
          need_cast=need_cast,
          need_squeeze=need_squeeze,
          out_dtype=out_dtype,
      )
  
      return img
  
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 24 for calling a global function with example usage: resize(img, size, interpolation, antialias) and returns: img