class_docstr: Implementation of ABINet multiloss that allows mixing different types of
  losses with weights.
  
  Args:
      dictionary (dict or :obj:`Dictionary`): The config for `Dictionary` or
          the instance of `Dictionary`.
      max_seq_len (int): Maximum sequence length. The sequence is usually
          generated from decoder. Defaults to 40.
      letter_case (str): There are three options to alter the letter cases
          of gt texts:
          - unchanged: Do not change gt texts.
          - upper: Convert gt texts into uppercase characters.
          - lower: Convert gt texts into lowercase characters.
          Usually, it only works for English characters. Defaults to
          'unchanged'.
      weight_vis (float or int): The weight of vision decoder loss. Defaults
          to 1.0.
      weight_dec (float or int): The weight of language decoder loss.
          Defaults to 1.0.
      weight_fusion (float or int): The weight of fuser (aligner) loss.
          Defaults to 1.0.
code: def __init__(
      self,
      dictionary: Union[Dict, Dictionary],
      max_seq_len: int = 40,
      letter_case: str = "unchanged",
      weight_vis: Union[float, int] = 1.0,
      weight_lang: Union[float, int] = 1.0,
      weight_fusion: Union[float, int] = 1.0,
      **kwargs,
  ) -> None:
      assert isinstance(weight_vis, (float, int))
      assert isinstance(weight_lang, (float, int))
      assert isinstance(weight_fusion, (float, int))
      super().__init__(
          dictionary=dictionary,
          max_seq_len=max_seq_len,
          letter_case=letter_case,
      )
      self.weight_vis = weight_vis
      self.weight_lang = weight_lang
      self.weight_fusion = weight_fusion
      self._ce_loss = CEModuleLoss(
          self.dictionary,
          max_seq_len,
          letter_case,
          reduction="mean",
          ignore_first_char=True,
      )
  
file_path: mmocr/mmocr/models/textrecog/module_losses/abi_module_loss.py
imports: from typing import Dict, Sequence, Union
  import torch
  from mmocr.models.common.dictionary import Dictionary
  from mmocr.registry import MODELS
  from mmocr.structures import TextRecogDataSample
  from .base import BaseTextRecogModuleLoss
  from .ce_module_loss import CEModuleLoss
label_desc: Use image node_id 1 to create a new ABIModuleLoss object from inherited base classes: BaseTextRecogModuleLoss with example: obj = ABIModuleLoss(dictionary, max_seq_len, letter_case, weight_vis, weight_lang, weight_fusion)