code: def tencrop_image2label(
      model: nn.Module, image: Tensor, crop_size: Tuple
  ) -> 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 and from their horisontally-flipped versions (10-Crop TTA).
  
      :param model: Classification model
      :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
  
      assert crop_height <= image_height
      assert crop_width <= image_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:]
  
      assert crop_tl.size(2) == crop_height
      assert crop_tr.size(2) == crop_height
      assert crop_bl.size(2) == crop_height
      assert crop_br.size(2) == crop_height
  
      assert crop_tl.size(3) == crop_width
      assert crop_tr.size(3) == crop_width
      assert crop_bl.size(3) == crop_width
      assert crop_br.size(3) == crop_width
  
      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,
      ]
      assert crop_cc.size(2) == crop_height
      assert crop_cc.size(3) == crop_width
  
      output = (
          model(crop_tl)
          + model(F.torch_fliplr(crop_tl))
          + model(crop_tr)
          + model(F.torch_fliplr(crop_tr))
          + model(crop_bl)
          + model(F.torch_fliplr(crop_bl))
          + model(crop_br)
          + model(F.torch_fliplr(crop_br))
          + model(crop_cc)
          + model(F.torch_fliplr(crop_cc))
      )
  
      one_over_10 = float(1.0 / 10.0)
      return output * one_over_10
  
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 6 for calling a global function with example usage: tencrop_image2label(model, image, crop_size) and returns: unknown