class_docstr: A special decoder responsible for mixing and aligning visual feature
  and linguistic feature. `ABINet <https://arxiv.org/abs/2103.06495>`_
  
  Args:
      dictionary (dict or :obj:`Dictionary`): The config for `Dictionary` or
          the instance of `Dictionary`. The dictionary must have an end
          token.
      vision_decoder (dict): The config for vision decoder.
      language_decoder (dict, optional): The config for language decoder.
      num_iters (int): Rounds of iterative correction. Defaults to 1.
      d_model (int): Hidden size :math:`E` of model. Defaults to 512.
      max_seq_len (int): Maximum sequence length :math:`T`. The
          sequence is usually generated from decoder. Defaults to 40.
      module_loss (dict, optional): Config to build loss. Defaults to None.
      postprocessor (dict, optional): Config to build postprocessor.
          Defaults to None.
      init_cfg (dict or list[dict], optional): Initialization configs.
          Defaults to None.
code: def __init__(
      self,
      dictionary: Union[Dict, Dictionary],
      vision_decoder: Dict,
      language_decoder: Optional[Dict] = None,
      d_model: int = 512,
      num_iters: int = 1,
      max_seq_len: int = 40,
      module_loss: Optional[Dict] = None,
      postprocessor: Optional[Dict] = None,
      init_cfg: Optional[Union[Dict, List[Dict]]] = None,
      **kwargs,
  ) -> None:
      super().__init__(
          dictionary=dictionary,
          module_loss=module_loss,
          postprocessor=postprocessor,
          max_seq_len=max_seq_len,
          init_cfg=init_cfg,
      )
  
      assert (
          self.dictionary.end_idx is not None
      ), "Dictionary must contain an end token! (with_end=True)"
  
      self.d_model = d_model
      self.num_iters = num_iters
      if language_decoder is not None:
          self.w_att = nn.Linear(2 * d_model, d_model)
          self.cls = nn.Linear(d_model, self.dictionary.num_classes)
  
      self.vision_decoder = vision_decoder
      self.language_decoder = language_decoder
      for cfg_name in ["vision_decoder", "language_decoder"]:
          if getattr(self, cfg_name, None) is not None:
              cfg = getattr(self, cfg_name)
              if cfg.get("dictionary", None) is None:
                  cfg.update(dictionary=self.dictionary)
              else:
                  warnings.warn(
                      f"Using dictionary {cfg['dictionary']} "
                      "in decoder's config."
                  )
              if cfg.get("max_seq_len", None) is None:
                  cfg.update(max_seq_len=max_seq_len)
              else:
                  warnings.warn(
                      f"Using max_seq_len {cfg['max_seq_len']} "
                      "in decoder's config."
                  )
              setattr(self, cfg_name, MODELS.build(cfg))
      self.softmax = nn.Softmax(dim=-1)
  
file_path: mmocr/mmocr/models/textrecog/decoders/abi_fuser.py
imports: import warnings
  from typing import Dict, List, Optional, Sequence, Union
  import torch
  import torch.nn
  from mmocr.models.common.dictionary import Dictionary
  from mmocr.registry import MODELS
  from mmocr.structures import TextRecogDataSample
  from .base import BaseDecoder
label_desc: Use image node_id 1 to create a new ABIFuser object from inherited base classes: BaseDecoder with example: obj = ABIFuser(dictionary, vision_decoder, language_decoder, d_model, num_iters, max_seq_len, module_loss, postprocessor, init_cfg)