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
code: def __init__(
      self, input_resolution, dim, norm_layer=nn.LayerNorm, is_v2=False
  ):
      super().__init__()
      self.input_resolution = input_resolution
      self.dim = dim
      self.reduction = nn.Linear(4 * dim, 2 * dim, bias=False)
      self.is_v2 = is_v2
      if self.is_v2:
          self.norm = norm_layer(2 * dim)
      else:
          self.norm = norm_layer(4 * dim)
  
imports: import torch
  from torch import nn
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, norm_layer, is_v2)