class_docstr: ESPnet2ASRTransducerModel module definition.
  
  Args:
      vocab_size: Size of complete vocabulary (w/ SOS/EOS and blank included).
      token_list: List of tokens in vocabulary (minus reserved tokens).
      frontend: Frontend module.
      specaug: SpecAugment module.
      normalize: Normalization module.
      encoder: Encoder module.
      decoder: Decoder module.
      joint_network: Joint Network module.
      transducer_weight: Weight of the Transducer loss.
      use_k2_pruned_loss: Whether to use k2 pruned Transducer loss.
      k2_pruned_loss_args: Arguments of the k2 loss pruned Transducer loss.
      warmup_steps: Number of steps in warmup, used for pruned loss scaling.
      validation_nstep: Maximum number of symbol expansions at each time step
                        when reporting CER or/and WER using mAES.
      fastemit_lambda: FastEmit lambda value.
      auxiliary_ctc_weight: Weight of auxiliary CTC loss.
      auxiliary_ctc_dropout_rate: Dropout rate for auxiliary CTC loss inputs.
      auxiliary_lm_loss_weight: Weight of auxiliary LM loss.
      auxiliary_lm_loss_smoothing: Smoothing rate for LM loss' label smoothing.
      ignore_id: Initial padding ID.
      sym_space: Space symbol.
      sym_blank: Blank Symbol.
      report_cer: Whether to report Character Error Rate during validation.
      report_wer: Whether to report Word Error Rate during validation.
      extract_feats_in_collect_stats: Whether to use extract_feats stats collection.
class_docstr_tok: ["ESPnet2ASRTransducerModel","module","definition",".","Args",":","vocab_size",":","Size","of","complete","vocabulary","(","w\/","SOS\/EOS","and","blank","included",")",".","token_list",":","List","of","tokens","in","vocabulary","(","minus","reserved","tokens",")",".","frontend",":","Frontend","module",".","specaug",":","SpecAugment","module",".","normalize",":","Normalization","module",".","encoder",":","Encoder","module",".","decoder",":","Decoder","module",".","joint_network",":","Joint","Network","module",".","transducer_weight",":","Weight","of","the","Transducer","loss",".","use_k2_pruned_loss",":","Whether","to","use","k2","pruned","Transducer","loss",".","k2_pruned_loss_args",":","Arguments","of","the","k2","loss","pruned","Transducer","loss",".","warmup_steps",":","Number","of","steps","in","warmup",",","used","for","pruned","loss","scaling",".","validation_nstep",":","Maximum","number","of","symbol","expansions","at","each","time","step","when","reporting","CER","or\/and","WER","using","mAES",".","fastemit_lambda",":","FastEmit","lambda","value",".","auxiliary_ctc_weight",":","Weight","of","auxiliary","CTC","loss",".","auxiliary_ctc_dropout_rate",":","Dropout","rate","for","auxiliary","CTC","loss","inputs",".","auxiliary_lm_loss_weight",":","Weight","of","auxiliary","LM","loss",".","auxiliary_lm_loss_smoothing",":","Smoothing","rate","for","LM","loss","'","label","smoothing",".","ignore_id",":","Initial","padding","ID",".","sym_space",":","Space","symbol",".","sym_blank",":","Blank","Symbol",".","report_cer",":","Whether","to","report","Character","Error","Rate","during","validation",".","report_wer",":","Whether","to","report","Word","Error","Rate","during","validation",".","extract_feats_in_collect_stats",":","Whether","to","use","extract_feats","stats","collection","."]
docstr: Compute LM loss (i.e.: Cross-entropy with smoothing).
  
  Args:
      decoder_out: Decoder output sequences. (B, U, D_dec)
      target: Target label ID sequences. (B, L)
  
  Return:
      loss_lm: LM loss value.
docstr_tok: ["Compute","LM","loss","(","i.e",".",":","Cross-entropy","with","smoothing",")",".","Args",":","decoder_out",":","Decoder","output","sequences",".","(","B",",","U",",","D_dec",")","target",":","Target","label","ID","sequences",".","(","B",",","L",")","Return",":","loss_lm",":","LM","loss","value","."]
code: def _calc_lm_loss(
      self,
      decoder_out: torch.Tensor,
      target: torch.Tensor,
  ) -> torch.Tensor:
      """Compute LM loss (i.e.: Cross-entropy with smoothing).
  
      Args:
          decoder_out: Decoder output sequences. (B, U, D_dec)
          target: Target label ID sequences. (B, L)
  
      Return:
          loss_lm: LM loss value.
  
      """
      batch_size = decoder_out.size(0)
  
      logp = torch.log_softmax(
          self.lm_lin(decoder_out[:, :-1, :]).view(-1, self.vocab_size),
          dim=1,
      )
      target = target.view(-1).type(torch.int64)
      ignore = (target == 0).unsqueeze(1)
  
      with torch.no_grad():
          true_dist = logp.clone().fill_(self.lm_loss_smooth_neg)
  
          true_dist.scatter_(
              1, target.unsqueeze(1), self.lm_loss_smooth_pos
          )
  
      loss_lm = torch.nn.functional.kl_div(
          logp, true_dist, reduction="none"
      )
      loss_lm = loss_lm.masked_fill(ignore, 0).sum() / batch_size
  
      return loss_lm
  
imports: import logging
  from contextlib import contextmanager
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from packaging.version import parse
  from typeguard import check_argument_types
  from espnet2.asr.frontend.abs_frontend import AbsFrontend
  from espnet2.asr.specaug.abs_specaug import AbsSpecAug
  from espnet2.asr_transducer.decoder.abs_decoder import AbsDecoder
  from espnet2.asr_transducer.encoder.encoder import Encoder
  from espnet2.asr_transducer.joint_network import JointNetwork
  from espnet2.asr_transducer.utils import get_transducer_task_io
  from espnet2.layers.abs_normalize import AbsNormalize
  from espnet2.torch_utils.device_funcs import force_gatherable
  from espnet2.train.abs_espnet_model import AbsESPnetModel
label_desc: Use image node_id 9 for calling the ESPnetASRTransducerModel obj's underlying member method code with example usage: obj._calc_lm_loss(decoder_out, target) and returns: loss_lm