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","."]
docstr: Forward function.
  
  Args:
      x (torch.Tensor): A Tensor of shape :math:`(N, H, W, C)`.
  
  Returns:
      torch.Tensor: A Tensor of shape :math:`(N, H/2, W, 2C)`.
docstr_tok: ["Forward","function",".","Args",":","x","(","torch.Tensor",")",":","A","Tensor","of","shape",":","math",":","`","(","N",",","H",",","W",",","C",")","`",".","Returns",":","torch.Tensor",":","A","Tensor","of","shape",":","math",":","`","(","N",",","H\/2",",","W",",","2C",")","`","."]
code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      """Forward function.
  
      Args:
          x (torch.Tensor): A Tensor of shape :math:`(N, H, W, C)`.
  
      Returns:
          torch.Tensor: A Tensor of shape :math:`(N, H/2, W, 2C)`.
      """
      if self.types == "Pool":
          x = (self.avgpool(x) + self.maxpool(x)) * 0.5
          out = self.proj(x.flatten(2).permute(0, 2, 1))
  
      else:
          x = self.conv(x)
          out = x.flatten(2).permute(0, 2, 1)
      out = self.norm(out)
      if self.act is not None:
          out = self.act(out)
  
      return out
  
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 2 for calling the MerigingBlock obj's underlying member method code with example usage: obj.forward(x) and returns: out