class_docstr: Transducer tasks module.
docstr: Compute CTC loss.
  
  Args:
      enc_out: Encoder output sequences. (B, T, D_enc)
      target: Target character ID sequences. (B, U)
      t_len: Time lengths. (B,)
      u_len: Label lengths. (B,)
  
  Returns:
      : CTC loss value.
docstr_tok: ["Compute","CTC","loss",".","Args",":","enc_out",":","Encoder","output","sequences",".","(","B",",","T",",","D_enc",")","target",":","Target","character","ID","sequences",".","(","B",",","U",")","t_len",":","Time","lengths",".","(","B",",",")","u_len",":","Label","lengths",".","(","B",",",")","Returns",":",":","CTC","loss","value","."]
code: def compute_ctc_loss(
      self,
      enc_out: torch.Tensor,
      target: torch.Tensor,
      t_len: torch.Tensor,
      u_len: torch.Tensor,
  ):
      """Compute CTC loss.
  
      Args:
          enc_out: Encoder output sequences. (B, T, D_enc)
          target: Target character ID sequences. (B, U)
          t_len: Time lengths. (B,)
          u_len: Label lengths. (B,)
  
      Returns:
          : CTC loss value.
  
      """
      ctc_lin = self.ctc_lin(
          torch.nn.functional.dropout(
              enc_out.to(dtype=torch.float32), p=self.ctc_dropout_rate
          )
      )
      ctc_logp = torch.log_softmax(ctc_lin.transpose(0, 1), dim=-1)
  
      with torch.backends.cudnn.flags(deterministic=True):
          loss_ctc = self.ctc_loss(ctc_logp, target, t_len, u_len)
  
      return loss_ctc.mean()
  
file_path: espnet/espnet/nets/pytorch_backend/transducer/transducer_tasks.py
imports: from typing import Any, List, Optional, Tuple
  import torch
  from espnet.nets.pytorch_backend.nets_utils import pad_list
  from espnet.nets.pytorch_backend.transducer.joint_network import JointNetwork
  from espnet.nets.pytorch_backend.transformer.label_smoothing_loss import LabelSmoothingLoss
label_desc: Use image node_id 3 for calling the TransducerTasks obj's underlying member method code with example usage: obj.compute_ctc_loss(enc_out, target, t_len, u_len) and returns: loss_ctc