class_docstr: Encoder decoder models with various lattice losses.
class_docstr_tok: ["Encoder","decoder","models","with","various","lattice","losses","."]
code: def __init__(self, cfg: DictConfig, trainer: Trainer = None):
      loss_type = cfg.graph_module_cfg.get("loss_type", "ctc")
      if loss_type != "ctc" and loss_type != "mmi":
          raise ValueError(
              f"Class {self.__class__.__name__} does not support `loss_type`={loss_type}"
          )
      super().__init__(cfg=cfg, trainer=trainer)
      self._init_k2()
  
imports: from typing import List, Optional
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from nemo.collections.asr.models.ctc_bpe_models import EncDecCTCModelBPE
  from nemo.collections.asr.models.ctc_models import EncDecCTCModel
  from nemo.collections.asr.models.rnnt_bpe_models import EncDecRNNTBPEModel
  from nemo.collections.asr.models.rnnt_models import EncDecRNNTModel
  from nemo.collections.asr.parts.k2.classes import ASRK2Mixin
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.utils import logging
label_desc: Use image node_id 1 to create a new EncDecK2SeqModel object from inherited base classes: EncDecCTCModel, ASRK2Mixin with example: obj = EncDecK2SeqModel(cfg, trainer)