code: def center_crop(img: Tensor, output_size: List[int]) -> Tensor:
      """Crops the given image at the center.
      If the image is torch Tensor, it is expected
      to have [..., H, W] shape, where ... means an arbitrary number of leading dimensions.
      If image size is smaller than output size along any edge, image is padded with 0 and then center cropped.
  
      Args:
          img (PIL Image or Tensor): Image to be cropped.
          output_size (sequence or int): (height, width) of the crop box. If int or sequence with single int,
              it is used for both directions.
  
      Returns:
          PIL Image or Tensor: Cropped image.
      """
      if not torch.jit.is_scripting() and not torch.jit.is_tracing():
          _log_api_usage_once(center_crop)
      if isinstance(output_size, numbers.Number):
          output_size = (int(output_size), int(output_size))
      elif (
          isinstance(output_size, (tuple, list))
          and len(output_size) == 1
      ):
          output_size = (output_size[0], output_size[0])
  
      _, image_height, image_width = get_dimensions(img)
      crop_height, crop_width = output_size
  
      if crop_width > image_width or crop_height > image_height:
          padding_ltrb = [
              (crop_width - image_width) // 2
              if crop_width > image_width
              else 0,
              (crop_height - image_height) // 2
              if crop_height > image_height
              else 0,
              (crop_width - image_width + 1) // 2
              if crop_width > image_width
              else 0,
              (crop_height - image_height + 1) // 2
              if crop_height > image_height
              else 0,
          ]
          img = pad(img, padding_ltrb, fill=0)  # PIL uses fill value 0
          _, image_height, image_width = get_dimensions(img)
          if crop_width == image_width and crop_height == image_height:
              return img
  
      crop_top = int(round((image_height - crop_height) / 2.0))
      crop_left = int(round((image_width - crop_width) / 2.0))
      return crop(img, crop_top, crop_left, crop_height, crop_width)
  
imports: import math
  import numbers
  import sys
  import warnings
  from enum import Enum
  from typing import Any, List, Optional, Tuple, Union
  import numpy
  import torch
  from PIL import Image
  from torch import Tensor
  from ..utils import _log_api_usage_once
  from .None import _functional_pil, _functional_tensor
label_desc: Use image node_id 16 for calling a global function with example usage: center_crop(img, output_size) and returns: crop, img