code: def fivecrop_image_augment(
      image: Tensor, crop_size: Tuple[int, int]
  ) -> Tensor:
      """Test-time augmentation for image classification that takes five crops out of input tensor (4 on corners and central)
      and averages predictions from them.
  
      :param image: Input image tensor
      :param crop_size: Crop size. Must be smaller than image size
      :return: Averaged logits
      """
      image_height, image_width = int(image.size(2)), int(image.size(3))
      crop_height, crop_width = crop_size
  
      if crop_height > image_height:
          raise ValueError(
              f"Tensor height ({image_height}) is less than requested crop size ({crop_height})"
          )
      if crop_width > image_width:
          raise ValueError(
              f"Tensor width ({image_width}) is less than requested crop size ({crop_width})"
          )
  
      bottom_crop_start = image_height - crop_height
      right_crop_start = image_width - crop_width
      crop_tl = image[..., :crop_height, :crop_width]
      crop_tr = image[..., :crop_height, right_crop_start:]
      crop_bl = image[..., bottom_crop_start:, :crop_width]
      crop_br = image[..., bottom_crop_start:, right_crop_start:]
  
      center_crop_y = (image_height - crop_height) // 2
      center_crop_x = (image_width - crop_width) // 2
      crop_cc = image[
          ...,
          center_crop_y : center_crop_y + crop_height,
          center_crop_x : center_crop_x + crop_width,
      ]
  
      return torch.cat(
          [crop_tl, crop_tr, crop_bl, crop_br, crop_cc],
          dim=0,
      )
  
imports: from collections import defaultdict
  from functools import partial
  from typing import Tuple, List, Optional, Union, Callable, Dict, Mapping
  import torch
  from torch import Tensor, nn
  from .None import functional
  from ..utils.support import pytorch_toolbelt_deprecated
label_desc: Use image node_id 3 for calling a global function with example usage: fivecrop_image_augment(image, crop_size) and returns: torch