class_docstr: The Mixing block.
  
  Args:
      embed_dims (int): Number of character components.
      num_heads (int): Number of heads
      mixer (str, optional): The mixer type. Defaults to 'Global'.
      window_size (Tuple[int ,int], optional): Local window size.
          Defaults to [7, 11].
      input_shape (Tuple[int, int], optional): The shape of input [H, W].
          Defaults to [8, 25].
      mlp_ratio (float, optional): The ratio of hidden features to input.
          Defaults to 4.0.
      qkv_bias (bool, optional): Whether a additive bias is required.
          Defaults to False.
      qk_scale (float, optional): A scaling factor. Defaults to None.
      drop (float, optional): cfg of Dropout. Defaults to 0..
      attn_drop (float, optional): cfg of Dropout. Defaults to 0.0.
      drop_path (float, optional): The probability of drop path.
          Defaults to 0.0.
      pernorm (bool, optional): Whether to place the MxingBlock before norm.
          Defaults to True.
      init_cfg (dict or list[dict], optional): Initialization configs.
          Defaults to None.
class_docstr_tok: ["The","Mixing","block",".","Args",":","embed_dims","(","int",")",":","Number","of","character","components",".","num_heads","(","int",")",":","Number","of","heads","mixer","(","str",",","optional",")",":","The","mixer","type",".","Defaults","to","'Global","'",".","window_size","(","Tuple","[","int",",","int","]",",","optional",")",":","Local","window","size",".","Defaults","to","[","7",",","11","]",".","input_shape","(","Tuple","[","int",",","int","]",",","optional",")",":","The","shape","of","input","[","H",",","W","]",".","Defaults","to","[","8",",","25","]",".","mlp_ratio","(","float",",","optional",")",":","The","ratio","of","hidden","features","to","input",".","Defaults","to","4.0.","qkv_bias","(","bool",",","optional",")",":","Whether","a","additive","bias","is","required",".","Defaults","to","False",".","qk_scale","(","float",",","optional",")",":","A","scaling","factor",".","Defaults","to","None",".","drop","(","float",",","optional",")",":","cfg","of","Dropout",".","Defaults","to","0","..","attn_drop","(","float",",","optional",")",":","cfg","of","Dropout",".","Defaults","to","0.0.","drop_path","(","float",",","optional",")",":","The","probability","of","drop","path",".","Defaults","to","0.0.","pernorm","(","bool",",","optional",")",":","Whether","to","place","the","MxingBlock","before","norm",".","Defaults","to","True",".","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*W, C)`.
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","*","W",",","C",")","`","."]
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*W, C)`.
      """
      if self.prenorm:
          x = self.norm1(x + self.drop_path(self.mixer(x)))
          x = self.norm2(x + self.drop_path(self.mlp(x)))
      else:
          x = x + self.drop_path(self.mixer(self.norm1(x)))
          x = x + self.drop_path(self.mlp(self.norm2(x)))
      return x
  
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 MixingBlock obj's underlying member method code with example usage: obj.forward(x) and returns: x