class_docstr: Patch Merging Layer.
  Args:
      dim (int): Number of input channels.
      norm_layer (str): Normalization layer name.
      strided (Optional[bool]): Down-sample the input by a factor of 2. Default is True.
class_docstr_tok: ["Patch","Merging","Layer",".","Args",":","dim","(","int",")",":","Number","of","input","channels",".","norm_layer","(","str",")",":","Normalization","layer","name",".","strided","(","Optional","[","bool","]",")",":","Down-sample","the","input","by","a","factor","of","2",".","Default","is","True","."]
code: def __init__(
      self,
      opts,
      dim: int,
      norm_layer: str,
      strided: Optional[bool] = True,
  ):
      super().__init__()
      self.dim = dim
      self.reduction = LinearLayer(
          in_features=4 * dim, out_features=2 * dim, bias=False
      )
      self.norm = get_normalization_layer(
          opts=opts, norm_type=norm_layer, num_features=4 * dim
      )
      self.strided = strided
  
imports: from typing import List, Optional
  import torch
  from torch import Tensor, nn
  from torch.nn import functional
  from cvnets.layers import Dropout, LinearLayer, StochasticDepth, get_normalization_layer
  from cvnets.layers.activation import build_activation_layer
  from cvnets.modules import BaseModule
label_desc: Use image node_id 1 to create a new PatchMerging object from inherited base classes: BaseModule with example: obj = PatchMerging(opts, dim, norm_layer, strided)