code: def interpolate(
      input,
      size=None,
      scale_factor=None,
      mode="nearest",
      align_corners=None,
  ):
      """
      A wrapper around :func:`torch.nn.functional.interpolate` to support zero-size tensor.
      """
      if input.numel() > 0:
          return torch.nn.functional.interpolate(
              input,
              size,
              scale_factor,
              mode,
              align_corners=align_corners,
          )
  
      def _check_size_scale_factor(dim):
          if size is None and scale_factor is None:
              raise ValueError(
                  "either size or scale_factor should be defined"
              )
          if size is not None and scale_factor is not None:
              raise ValueError(
                  "only one of size or scale_factor should be defined"
              )
          if (
              scale_factor is not None
              and isinstance(scale_factor, tuple)
              and len(scale_factor) != dim
          ):
              raise ValueError(
                  "scale_factor shape must match input shape. "
                  "Input is {}D, scale_factor size is {}".format(
                      dim, len(scale_factor)
                  )
              )
  
      def _output_size(dim):
          _check_size_scale_factor(dim)
          if size is not None:
              return size
          scale_factors = _ntuple(dim)(scale_factor)
          # math.floor might return float in py2.7
          return [
              int(math.floor(input.size(i + 2) * scale_factors[i]))
              for i in range(dim)
          ]
  
      output_shape = tuple(_output_size(2))
      output_shape = input.shape[:-2] + output_shape
      return _NewEmptyTensorOp.apply(input, output_shape)
  
file_path: gluon-cv/gluoncv/torch/data/structures/keypoints.py
imports: from typing import Any, List, Tuple, Union
  import numpy
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: interpolate(input, size, scale_factor, mode, align_corners) and returns: _NewEmptyTensorOp, torch, unknown, size