class_docstr: Patch Merging Layer.
  Args:
      input_resolution (tuple[int]): Resolution of input feature.
      dim (int): Number of input channels.
      norm_layer (nn.Layer, optional): Normalization layer.  Default: nn.LayerNorm
class_docstr_tok: ["Patch","Merging","Layer",".","Args",":","input_resolution","(","tuple","[","int","]",")",":","Resolution","of","input","feature",".","dim","(","int",")",":","Number","of","input","channels",".","norm_layer","(","nn.Layer",",","optional",")",":","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
      ), "x size ({}*{}) are not even.".format(H, W)
  
      x = x.reshape([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 = paddle.concat([x0, x1, x2, x3], -1)  # B H/2 W/2 4*C
      x = x.reshape([B, H * W // 4, 4 * C])  # B H/2*W/2 4*C
  
      x = self.norm(x)
      x = self.reduction(x)
  
      return x
  
imports: import numpy
  import paddle
  import paddle.nn
  from medicalseg.cvlibs import manager, param_init
  from medicalseg.utils import load_pretrained_model
  from medicalseg.models.backbones.transformer_utils import DropPath, to_2tuple
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