class_docstr: Transducer tasks module.
docstr: Compute Transducer loss.
  
  Args:
      enc_out: Encoder output sequences. (B, T, D_enc)
      dec_out: Decoder output sequences. (B, U, D_dec)
      target: Target label ID sequences. (B, L)
      t_len: Time lengths. (B,)
      u_len: Label lengths. (B,)
  
  Returns:
      (joint_out, loss_trans):
          Joint output sequences. (B, T, U, D_joint),
          Transducer loss value.
docstr_tok: ["Compute","Transducer","loss",".","Args",":","enc_out",":","Encoder","output","sequences",".","(","B",",","T",",","D_enc",")","dec_out",":","Decoder","output","sequences",".","(","B",",","U",",","D_dec",")","target",":","Target","label","ID","sequences",".","(","B",",","L",")","t_len",":","Time","lengths",".","(","B",",",")","u_len",":","Label","lengths",".","(","B",",",")","Returns",":","(","joint_out",",","loss_trans",")",":","Joint","output","sequences",".","(","B",",","T",",","U",",","D_joint",")",",","Transducer","loss","value","."]
code: def compute_transducer_loss(
      self,
      enc_out: torch.Tensor,
      dec_out: torch.tensor,
      target: torch.Tensor,
      t_len: torch.Tensor,
      u_len: torch.Tensor,
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """Compute Transducer loss.
  
      Args:
          enc_out: Encoder output sequences. (B, T, D_enc)
          dec_out: Decoder output sequences. (B, U, D_dec)
          target: Target label ID sequences. (B, L)
          t_len: Time lengths. (B,)
          u_len: Label lengths. (B,)
  
      Returns:
          (joint_out, loss_trans):
              Joint output sequences. (B, T, U, D_joint),
              Transducer loss value.
  
      """
      joint_out = self.joint_network(
          enc_out.unsqueeze(2), dec_out.unsqueeze(1)
      )
  
      loss_trans = self.transducer_loss(joint_out, target, t_len, u_len)
      loss_trans /= joint_out.size(0)
  
      return joint_out, loss_trans
  
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 2 for calling the TransducerTasks obj's underlying member method code with example usage: obj.compute_transducer_loss(enc_out, dec_out, target, t_len, u_len) and returns: joint_out,  loss_trans