class_docstr: Patch Merging Layer.
  Args:
      input_resolution (`tuple[int]`):
          Resolution of input feature.
      dim (`int`):
          Number of input channels.
      norm_layer (`nn.Module`):
          Normalization layer.  Default: nn.LayerNorm
docstr: x: B, H*W, C
docstr_tok: ["x",":","B",",","H","*","W",",","C"]
code: def forward(self, x):
      """
      x: B, H*W, C
      """
      h, w = self.input_resolution
      b, l, c = x.shape
      assert l == h * w, "input feature has wrong size"
      assert (
          h % 2 == 0 and w % 2 == 0
      ), f"x size ({h}*{w}) are not even."
  
      x = x.view(b, h, w, c)
  
      x0 = x[:, 0::2, 0::2, :]  # B H/2 W/2 C
      x1 = x[:, 1::2, 0::2, :]  # B H/2 W/2 C
      x2 = x[:, 0::2, 1::2, :]  # B H/2 W/2 C
      x3 = x[:, 1::2, 1::2, :]  # B H/2 W/2 C
      x = torch.cat([x0, x1, x2, x3], -1)  # B H/2 W/2 4*C
      x = x.view(b, -1, 4 * c)  # B H/2*W/2 4*C
      if self.is_v2:
          x = self.reduction(x)
          x = self.norm(x)
      else:
          x = self.norm(x)
          x = self.reduction(x)
  
      return x
  
imports: import torch
  from torch import nn
label_desc: Use image node_id 2 for calling the PatchMerging obj's underlying member method code with example usage: obj.forward(x) and returns: x