code: def forward(self, x):
      if x.ndim == 3:
          H, W = self.input_resolution
          B = x.shape[0]
          # (B, C, H, W)
          x = x.reshape((B, H, W, -1)).transpose((0, 3, 1, 2))
  
      x = self.conv1(x)
      x = self.act(x)
  
      x = self.conv2(x)
      x = self.act(x)
      x = self.conv3(x)
      x = x.flatten(2).transpose((0, 2, 1))
      return x
  
imports: import itertools
  import paddle
  from paddle import nn
  from paddle.nn import functional
  from .common import LayerNorm2d
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