class_docstr: Patch Merging Layer.
  Args:
      dim (int): Number of input channels.
      norm_layer (nn.Module): Normalization layer. Default: nn.LayerNorm.
class_docstr_tok: ["Patch","Merging","Layer",".","Args",":","dim","(","int",")",":","Number","of","input","channels",".","norm_layer","(","nn.Module",")",":","Normalization","layer",".","Default",":","nn.LayerNorm","."]
code: def __init__(
      self,
      dim: int,
      norm_layer: Callable[..., nn.Module] = nn.LayerNorm,
  ):
      super().__init__()
      _log_api_usage_once(self)
      self.dim = dim
      self.reduction = nn.Linear(4 * dim, 2 * dim, bias=False)
      self.norm = norm_layer(4 * dim)
  
imports: import math
  from functools import partial
  from typing import Any, Callable, List, Optional
  import torch
  import torch.nn.functional
  from torch import nn, Tensor
  from ..ops.misc import MLP, Permute
  from ..ops.stochastic_depth import StochasticDepth
  from ..transforms._presets import ImageClassification, InterpolationMode
  from ..utils import _log_api_usage_once
  from ._api import register_model, Weights, WeightsEnum
  from ._meta import _IMAGENET_CATEGORIES
  from ._utils import _ovewrite_named_param, handle_legacy_interface
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)