class_docstr: Patch Merging Layer
  
  Args:
      dim (int): Number of input channels.
      norm_layer (nn.Module, optional): Normalization layer.  Default: nn.LayerNorm
class_docstr_tok: ["Patch","Merging","Layer","Args",":","dim","(","int",")",":","Number","of","input","channels",".","norm_layer","(","nn.Module",",","optional",")",":","Normalization","layer",".","Default",":","nn.LayerNorm"]
code: def __init__(self, dim, norm_layer=nn.LayerNorm):
      super().__init__()
      self.dim = dim
      self.reduction = nn.Linear(4 * dim, 2 * dim, bias=False)
      self.norm = norm_layer(4 * dim)
  
imports: from collections import OrderedDict
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils.checkpoint
  from torch import Tensor
  from .common import EncoderModule, _take, make_n_channel_input
  from ..activations import get_activation_block, ACT_GELU
  from timm.models.layers import DropPath, to_2tuple, trunc_normal_
label_desc: Use image node_id 1 to create a new PatchMerging object from inherited base classes: nn with example: obj = PatchMerging(dim, norm_layer)