class_docstr: 3D Swin Transformer Block.
  
  Args:
      dim (`int`):
          Number of input channels.
      num_heads (`int`):
          Number of attention heads.
      window_size (`tuple[int]`):
          Window size.
      shift_size (`tuple[int]`):
          Shift size for SW-MSA.
      mlp_ratio (`float`):
          Ratio of mlp hidden dim to embedding dim.
      qkv_bias (`bool`):
          If True, add a learnable bias to query, key, value. Default: True
      qk_scale (`float`):
          Override default qk scale of head_dim ** -0.5 if set.
      drop (`float`):
          Dropout rate. Default: 0.0
      attn_drop (`float`):
          Attention dropout rate. Default: 0.0
      drop_path(`float`):
          Stochastic depth rate. Default: 0.0
      act_layer (`nn.Module`):
          Activation layer. Default: nn.GELU
      norm_layer (`nn.Module`):
          Normalization layer.  Default: nn.LayerNorm
docstr: Forward function.
  Args:
      x (`tensor`):
          Input feature, tensor size (B, D, H, W, C).
      mask_matrix (`tuple[int]`):
          Attention mask for cyclic shift.
docstr_tok: ["Forward","function",".","Args",":","x","(","`","tensor","`",")",":","Input","feature",",","tensor","size","(","B",",","D",",","H",",","W",",","C",")",".","mask_matrix","(","`","tuple","[","int","]","`",")",":","Attention","mask","for","cyclic","shift","."]
code: def forward(self, x, mask_matrix):
      """Forward function.
      Args:
          x (`tensor`):
              Input feature, tensor size (B, D, H, W, C).
          mask_matrix (`tuple[int]`):
              Attention mask for cyclic shift.
      """
  
      shortcut = x
      if self.use_checkpoint:
          x = checkpoint.checkpoint(self.forward_part1, x, mask_matrix)
      else:
          x = self.forward_part1(x, mask_matrix)
      x = shortcut + self.drop_path(x)
  
      if self.use_checkpoint:
          x = x + checkpoint.checkpoint(self.forward_part2, x)
      else:
          x = x + self.forward_part2(x)
  
      return x
  
file_path: towhee/towhee/models/layers/swin_transformer_block3d.py
imports: import torch
  from torch import nn
  from torch.utils import checkpoint
  import torch.nn.functional
  from towhee.models.layers.window_attention3d import WindowAttention3D
  from towhee.models.utils.window_partition3d import window_partition
  from towhee.models.utils.window_reverse3d import window_reverse
  from towhee.models.layers.mlp import Mlp
  from towhee.models.utils.get_window_size import get_window_size
  from towhee.models.layers.droppath import DropPath
label_desc: Use image node_id 4 for calling the SwinTransformerBlock3D obj's underlying member method code with example usage: obj.forward(x, mask_matrix) and returns: x