code: def forward(self, attn_logprob, in_lens, out_lens):
      key_lens = in_lens
      query_lens = out_lens
      max_key_len = attn_logprob.size(-1)
  
      # Reorder input to [query_len, batch_size, key_len]
      attn_logprob = attn_logprob.squeeze(1)
      attn_logprob = attn_logprob.permute(1, 0, 2)
  
      # Add blank label
      attn_logprob = F.pad(
          input=attn_logprob,
          pad=(1, 0, 0, 0, 0, 0),
          value=self.blank_logprob,
      )
  
      # Convert to log probabilities
      # Note: Mask out probs beyond key_len
      key_inds = torch.arange(
          max_key_len + 1, device=attn_logprob.device, dtype=torch.long
      )
      attn_logprob.masked_fill_(
          key_inds.view(1, 1, -1) > key_lens.view(1, -1, 1), -1e15
      )  # key_inds >= key_lens+1
      attn_logprob = self.log_softmax(attn_logprob)
  
      # Target sequences
      target_seqs = key_inds[1:].unsqueeze(0)
      target_seqs = target_seqs.repeat(key_lens.numel(), 1)
  
      # Evaluate CTC loss
      cost = self.ctc_loss(
          attn_logprob,
          target_seqs,
          input_lengths=query_lens,
          target_lengths=key_lens,
      )
      cost *= self.loss_scale
  
      return cost
  
file_path: NeMo/nemo/collections/tts/losses/aligner_loss.py
imports: import torch
  import torch.nn.functional
  from nemo.core.classes import Loss, typecheck
  from nemo.core.neural_types.elements import LengthsType, LogprobsType, LossType, ProbsType
  from nemo.core.neural_types.neural_type import NeuralType
label_desc: Use image node_id 4 for calling the ForwardSumLoss obj's underlying member method code with example usage: obj.forward(attn_logprob, in_lens, out_lens) and returns: cost