class_docstr: Transducer tasks module.
docstr: Get Transducer tasks inputs and outputs.
  
  Args:
      labels: Label ID sequences. (B, U)
      enc_out_len: Time lengths. (B,)
      aux_enc_out_len: Auxiliary time lengths. [N X (B,)]
  
  Returns:
      target: Target label ID sequences. (B, L)
      lm_loss_target: LM loss target label ID sequences. (B, U)
      t_len: Time lengths. (B,)
      aux_t_len: Auxiliary time lengths. [N x (B,)]
      u_len: Label lengths. (B,)
docstr_tok: ["Get","Transducer","tasks","inputs","and","outputs",".","Args",":","labels",":","Label","ID","sequences",".","(","B",",","U",")","enc_out_len",":","Time","lengths",".","(","B",",",")","aux_enc_out_len",":","Auxiliary","time","lengths",".","[","N","X","(","B",",",")","]","Returns",":","target",":","Target","label","ID","sequences",".","(","B",",","L",")","lm_loss_target",":","LM","loss","target","label","ID","sequences",".","(","B",",","U",")","t_len",":","Time","lengths",".","(","B",",",")","aux_t_len",":","Auxiliary","time","lengths",".","[","N","x","(","B",",",")","]","u_len",":","Label","lengths",".","(","B",",",")"]
code: def get_transducer_tasks_io(
      self,
      labels: torch.Tensor,
      enc_out_len: torch.Tensor,
      aux_enc_out_len: Optional[List],
  ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
      """Get Transducer tasks inputs and outputs.
  
      Args:
          labels: Label ID sequences. (B, U)
          enc_out_len: Time lengths. (B,)
          aux_enc_out_len: Auxiliary time lengths. [N X (B,)]
  
      Returns:
          target: Target label ID sequences. (B, L)
          lm_loss_target: LM loss target label ID sequences. (B, U)
          t_len: Time lengths. (B,)
          aux_t_len: Auxiliary time lengths. [N x (B,)]
          u_len: Label lengths. (B,)
  
      """
      device = labels.device
  
      labels_unpad = [
          label[label != self.ignore_id] for label in labels
      ]
      blank = labels[0].new([self.blank_id])
  
      target = (
          pad_list(labels_unpad, self.blank_id)
          .type(torch.int32)
          .to(device)
      )
      lm_loss_target = (
          pad_list(
              [torch.cat([y, blank], dim=0) for y in labels_unpad],
              self.ignore_id,
          )
          .type(torch.int64)
          .to(device)
      )
  
      self.set_target(target)
  
      if enc_out_len.dim() > 1:
          enc_mask_unpad = [m[m != 0] for m in enc_out_len]
          enc_out_len = list(
              map(int, [m.size(0) for m in enc_mask_unpad])
          )
      else:
          enc_out_len = list(map(int, enc_out_len))
  
      t_len = torch.IntTensor(enc_out_len).to(device)
      u_len = torch.IntTensor(
          [label.size(0) for label in labels_unpad]
      ).to(device)
  
      if aux_enc_out_len:
          aux_t_len = []
  
          for i in range(len(aux_enc_out_len)):
              if aux_enc_out_len[i].dim() > 1:
                  aux_mask_unpad = [
                      aux[aux != 0] for aux in aux_enc_out_len[i]
                  ]
                  aux_t_len.append(
                      torch.IntTensor(
                          list(
                              map(
                                  int,
                                  [
                                      aux.size(0)
                                      for aux in aux_mask_unpad
                                  ],
                              )
                          )
                      ).to(device)
                  )
              else:
                  aux_t_len.append(
                      torch.IntTensor(
                          list(map(int, aux_enc_out_len[i]))
                      ).to(device)
                  )
      else:
          aux_t_len = aux_enc_out_len
  
      return target, lm_loss_target, t_len, aux_t_len, u_len
  
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 8 for calling the TransducerTasks obj's underlying member method code with example usage: obj.get_transducer_tasks_io(labels, enc_out_len, aux_enc_out_len) and returns: target,  lm_loss_target,  t_len,  aux_t_len,  u_len