code: def forward(
      self,
      text: torch.Tensor,
      text_lengths: torch.Tensor,
      **kwargs,
  ) -> Tuple[torch.Tensor, Dict[str, torch.Tensor], torch.Tensor]:
      nll, y_lengths = self.nll(text, text_lengths)
      ntokens = y_lengths.sum()
      loss = nll.sum() / ntokens
      stats = dict(loss=loss.detach())
  
      # force_gatherable: to-device and to-tensor if scalar for DataParallel
      loss, stats, weight = force_gatherable(
          (loss, stats, ntokens), loss.device
      )
      return loss, stats, weight
  
file_path: espnet/espnet2/lm/espnet_model.py
imports: from typing import Dict, Optional, Tuple
  import torch
  import torch.nn.functional
  from typeguard import check_argument_types
  from espnet2.lm.abs_model import AbsLM
  from espnet2.torch_utils.device_funcs import force_gatherable
  from espnet2.train.abs_espnet_model import AbsESPnetModel
  from espnet.nets.pytorch_backend.nets_utils import make_pad_mask
label_desc: Use image node_id 4 for calling the ESPnetLanguageModel obj's underlying member method code with example usage: obj.forward(text, text_lengths) and returns: loss,  stats,  weight