code: def rescale(
      input: torch.Tensor,
      factor: Union[float, Tuple[float, float]],
      interpolation: str = "bilinear",
      align_corners: Optional[bool] = None,
      antialias: bool = False,
  ) -> torch.Tensor:
      r"""Rescale the input torch.Tensor with the given factor.
  
      .. image:: _static/img/rescale.png
  
      Args:
          input: The image tensor to be scale with shape of :math:`(B, C, H, W)`.
          factor: Desired scaling factor in each direction. If scalar, the value is used
              for both the x- and y-direction.
          interpolation:  algorithm used for upsampling: ``'nearest'`` | ``'linear'`` | ``'bilinear'`` |
              ``'bicubic'`` | ``'trilinear'`` | ``'area'``.
          align_corners: interpolation flag.
          side: Corresponding side if ``size`` is an integer. Can be one of ``'short'``, ``'long'``, ``'vert'``,
              or ``'horz'``.
          antialias: if True, then image will be filtered with Gaussian before downscaling.
              No effect for upscaling.
  
      Returns:
          The rescaled tensor with the shape as the specified size.
  
      Example:
          >>> img = torch.rand(1, 3, 4, 4)
          >>> out = rescale(img, (2, 3))
          >>> print(out.shape)
          torch.Size([1, 3, 8, 12])
      """
      if isinstance(factor, float):
          factor_vert = factor_horz = factor
      else:
          factor_vert, factor_horz = factor
  
      height, width = input.size()[-2:]
      size = (int(height * factor_vert), int(width * factor_horz))
      return resize(
          input,
          size,
          interpolation=interpolation,
          align_corners=align_corners,
          antialias=antialias,
      )
  
imports: from typing import Optional, Tuple, Union
  import torch
  from torch import nn
  from kornia.core import ones, ones_like, zeros
  from kornia.filters import gaussian_blur2d
  from kornia.utils import _extract_device_dtype
  from kornia.utils.image import perform_keep_shape_image
  from kornia.utils.misc import eye_like
  from .imgwarp import get_affine_matrix2d, get_projective_transform, get_rotation_matrix2d, warp_affine, warp_affine3d
label_desc: Use image node_id 17 for calling a global function with example usage: rescale(input, factor, interpolation, align_corners, antialias) and returns: resize