class_docstr: Interlaced sparse multi-head self attention module with relative position bias.
  Args:
      embed_dim (int): Number of input channels.
      num_heads (int): Number of attention heads.
      window_size (int, optional): Window size. Default: 7.
      rpe (bool, optional): Whether to use rpe. Default: True.
class_docstr_tok: ["Interlaced","sparse","multi-head","self","attention","module","with","relative","position","bias",".","Args",":","embed_dim","(","int",")",":","Number","of","input","channels",".","num_heads","(","int",")",":","Number","of","attention","heads",".","window_size","(","int",",","optional",")",":","Window","size",".","Default",":","7.","rpe","(","bool",",","optional",")",":","Whether","to","use","rpe",".","Default",":","True","."]
code: def __init__(
      self, embed_dim, num_heads, window_size=7, rpe=True, **kwargs
  ):
      super(InterlacedPoolAttention, self).__init__()
  
      self.dim = embed_dim
      self.num_heads = num_heads
      self.window_size = window_size
      self.with_rpe = rpe
      self.attn = Attention(
          embed_dim,
          num_heads,
          rpe=rpe,
          window_size=window_size,
          **kwargs,
      )
      self.pad_helper = PadHelper(window_size)
      self.permute_helper = LocalPermuteHelper(window_size)
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager, param_init
  from paddleseg.models import layers
  from paddleseg.utils import utils, logger
  from paddleseg.models.backbones.transformer_utils import *
label_desc: Use image node_id 1 to create a new InterlacedPoolAttention object from inherited base classes: nn with example: obj = InterlacedPoolAttention(embed_dim, num_heads, window_size, rpe)