code: def __init__(self, input_resolution, dim, out_dim, activation):
      super().__init__()
  
      self.input_resolution = input_resolution
      self.dim = dim
      self.out_dim = out_dim
      self.act = activation()
      self.conv1 = Conv2d_BN(dim, out_dim, 1, 1, 0)
      stride_c = 2
      if out_dim == 320 or out_dim == 448 or out_dim == 576:
          stride_c = 1
      self.conv2 = Conv2d_BN(
          out_dim, out_dim, 3, stride_c, 1, groups=out_dim
      )
      self.conv3 = Conv2d_BN(out_dim, out_dim, 1, 1, 0)
  
imports: import itertools
  import paddle
  from paddle import nn
  from paddle.nn import functional
  from .common import LayerNorm2d
label_desc: Use image node_id 1 to create a new PatchMerging object from inherited base classes: nn with example: obj = PatchMerging(input_resolution, dim, out_dim, activation)