code: def unfold_wo_center(x, kernel_size: int, dilation: int) -> Tensor:
      """unfold_wo_center, used in original implement in BoxInst:
  
      https://github.com/aim-uofa/AdelaiDet/blob/\
      4a3a1f7372c35b48ebf5f6adc59f135a0fa28d60/\
      adet/modeling/condinst/condinst.py#L53
      """
      assert x.dim() == 4
      assert kernel_size % 2 == 1
  
      # using SAME padding
      padding = (kernel_size + (dilation - 1) * (kernel_size - 1)) // 2
      unfolded_x = F.unfold(
          x, kernel_size=kernel_size, padding=padding, dilation=dilation
      )
      unfolded_x = unfolded_x.reshape(
          x.size(0), x.size(1), -1, x.size(2), x.size(3)
      )
      # remove the center pixels
      size = kernel_size**2
      unfolded_x = torch.cat(
          (
              unfolded_x[:, :, : size // 2],
              unfolded_x[:, :, size // 2 + 1 :],
          ),
          dim=2,
      )
  
      return unfolded_x
  
imports: from functools import partial
  from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from mmengine.utils import digit_version
  from six.moves import map, zip
  from torch import Tensor
  from torch.autograd import Function
  from torch.nn import functional
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import BaseBoxes, get_box_type, stack_boxes
  from mmdet.structures.mask import BitmapMasks, PolygonMasks
  from mmdet.utils import OptInstanceList
label_desc: Use image node_id 23 for calling a global function with example usage: unfold_wo_center(x, kernel_size, dilation) and returns: unfolded_x