class_docstr: The last block of any stage, except for the last stage.
  
  Args:
      in_channels (int): The channels of input.
      out_channels (int): The channels of output.
      types (str, optional): Which downsample operation of ['Pool', 'Conv'].
          Defaults to 'Pool'.
      stride (Union[int, Tuple[int, int]], optional): Stride of the Conv.
          Defaults to [2, 1].
      act (bool, optional): activation function. Defaults to None.
      init_cfg (dict or list[dict], optional): Initialization configs.
          Defaults to None.
class_docstr_tok: ["The","last","block","of","any","stage",",","except","for","the","last","stage",".","Args",":","in_channels","(","int",")",":","The","channels","of","input",".","out_channels","(","int",")",":","The","channels","of","output",".","types","(","str",",","optional",")",":","Which","downsample","operation","of","[","'Pool","'",",","'Conv","'","]",".","Defaults","to","'Pool","'",".","stride","(","Union","[","int",",","Tuple","[","int",",","int","]","]",",","optional",")",":","Stride","of","the","Conv",".","Defaults","to","[","2",",","1","]",".","act","(","bool",",","optional",")",":","activation","function",".","Defaults","to","None",".","init_cfg","(","dict","or","list","[","dict","]",",","optional",")",":","Initialization","configs",".","Defaults","to","None","."]
code: def __init__(
      self,
      in_channels: int,
      out_channels: int,
      types: str = "Pool",
      stride: Union[int, Tuple[int, int]] = [2, 1],
      act: bool = None,
      init_cfg: Optional[Union[Dict, List[Dict]]] = None,
  ):
      super().__init__(init_cfg)
      self.types = types
      if types == "Pool":
          self.avgpool = nn.AvgPool2d(
              kernel_size=[3, 5], stride=stride, padding=[1, 2]
          )
          self.maxpool = nn.MaxPool2d(
              kernel_size=[3, 5], stride=stride, padding=[1, 2]
          )
          self.proj = nn.Linear(in_channels, out_channels)
      else:
          self.conv = nn.Conv2d(
              in_channels,
              out_channels,
              kernel_size=3,
              stride=stride,
              padding=1,
          )
      self.norm = nn.LayerNorm(out_channels)
      if act is not None:
          self.act = act()
      else:
          self.act = None
  
imports: from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule
  from mmcv.cnn.bricks import DropPath
  from mmengine.model import BaseModule
  from mmengine.model.weight_init import trunc_normal_init
  from mmocr.registry import MODELS
  from mmocr.structures import TextRecogDataSample
label_desc: Use image node_id 1 to create a new MerigingBlock object from inherited base classes: BaseModule with example: obj = MerigingBlock(in_channels, out_channels, types, stride, act, init_cfg)