code: def forward(self, x):
      B, H, W, _ = x.shape
  
      shortcut = x
      x = self.norm1(x)
      # Window partition
      pad_hw: Optional[Tuple[int, int]] = None
      if self.window_size > 0:
          x, pad_hw = window_partition(x, self.window_size)
  
      x = self.drop_path1(self.ls1(self.attn(x)))
  
      # Reverse window partition
      if self.window_size > 0:
          x = window_unpartition(x, self.window_size, (H, W), pad_hw)
  
      x = shortcut + x
  
      x = x.reshape(B, H * W, -1)  # MLP is faster for N, L, C tensor
      x = x + self.drop_path2(self.ls2(self.mlp(self.norm2(x))))
      x = x.reshape(B, H, W, -1)
  
      return x
  
imports: import logging
  from functools import partial
  from typing import Callable, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils.checkpoint
  from torch.jit import Final
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_INCEPTION_MEAN, IMAGENET_INCEPTION_STD
  from timm.layers import PatchEmbed, Mlp, DropPath, PatchDropout, LayerNorm2d, ClassifierHead, NormMlpClassifierHead, Format, resample_abs_pos_embed_nhwc, RotaryEmbeddingCat, apply_rot_embed_cat, to_2tuple, use_fused_attn
  from ._builder import build_model_with_cfg
  from ._manipulate import checkpoint_seq
  from ._registry import generate_default_cfgs, register_model
  from ._features_fx import register_notrace_function
label_desc: Use image node_id 2 for calling the Block obj's underlying member method code with example usage: obj.forward(x) and returns: x