code: def scale(
      tens: Tensor, scale_factor: int, interpolation="bilinear"
  ) -> Tensor:
      interpolation_methods = {
          "nearest": INTER_NEAREST,
          "0": INTER_NEAREST,
          0: INTER_NEAREST,  # 0
          "bilinear": INTER_LINEAR,
          "1": INTER_LINEAR,
          1: INTER_LINEAR,  # 1
          "bicubic": INTER_CUBIC,
          "2": INTER_CUBIC,
          2: INTER_CUBIC,  # 2
          "area": INTER_AREA,
          "3": INTER_AREA,
          3: INTER_AREA,  # 3
      }
      if interpolation not in interpolation_methods:
          raise ValueError(
              "Specify a valid interpolation type - area/nearest/bicubic/bilinear"
          )
  
      if scale_factor > 1:
          # Neater, more precise
          interpolation = "bicubic"
  
      height, width = tens.shape[:2]
      new_height, new_width = int(height * scale_factor), int(
          width * scale_factor
      )
  
      tens = cv.resize(
          tens, (new_width, new_height), interpolation=interpolation
      )
      return to_tensor(tens, override_checks=True)
  
imports: import numpy
  import cv2
  import random
  import collections
  from ..coreten import Tensor, to_tensor
  from .._internal import _check_target_size
  from ..globals import INTER_AREA, INTER_CUBIC, INTER_NEAREST, INTER_LINEAR
  from ..annotations import Union, Tuple, Optional
label_desc: Use image node_id 11 for calling a global function with example usage: scale(tens, scale_factor, interpolation) and returns: to_tensor