code: def inverse_divisible_pad_t(
      x: Tensor,
      pad_sizes: tuple[
          tuple[int, int],
          tuple[int, int],
          tuple[int, int],
          int,
          int,
          int,
      ],
  ) -> Tensor:
      """
      De-pad network output to match its original shape
  
      Args:
          x: input of shape (B,C,H,W) for 2D data or (B,C,H,W,D) for 3D data
          pad_sizes: padding values
  
      Returns:
          de-padded input
      """
      h_pad, w_pad, d_pad, h_mult, w_mult, d_mult = pad_sizes
  
      if len(x.shape) == 4:  # this is 2D
          return x[
              ...,
              h_pad[0] : h_mult - h_pad[1],
              w_pad[0] : w_mult - w_pad[1],
          ]
  
      elif len(x.shape) == 5:  # this is 3D
          return x[
              ...,
              h_pad[0] : h_mult - h_pad[1],
              w_pad[0] : w_mult - w_pad[1],
              d_pad[0] : d_mult - d_pad[1],
          ]
  
      else:
          raise ValueError(
              f"only 2D (B,C,H,W) and 3D (B,C,H,W,D) data are supported but x has shape {x.shape}"
          )
  
file_path: MONAI/monai/apps/reconstruction/networks/nets/utils.py
imports: from __future__ import annotations
  import math
  from torch import Tensor
  from torch.nn import functional
  from monai.apps.reconstruction.complex_utils import complex_conj_t, complex_mul_t
  from monai.networks.blocks.fft_utils_t import fftn_centered_t, ifftn_centered_t
label_desc: Use image node_id 7 for calling a global function with example usage: inverse_divisible_pad_t(x, pad_sizes) and returns: x, x