class_docstr: torchaudio.models.RNNT()
  
  Recurrent neural network transducer (RNN-T) model.
  
  Note:
      To build the model, please use one of the factory functions.
  
  See Also:
      :class:`torchaudio.pipelines.RNNTBundle`: ASR pipeline with pre-trained models.
  
  Args:
      transcriber (torch.nn.Module): transcription network.
      predictor (torch.nn.Module): prediction network.
      joiner (torch.nn.Module): joint network.
class_docstr_tok: ["torchaudio.models.RNNT","(",")","Recurrent","neural","network","transducer","(","RNN-T",")","model",".","Note",":","To","build","the","model",",","please","use","one","of","the","factory","functions",".","See","Also",":",":","class",":","`","torchaudio.pipelines.RNNTBundle","`",":","ASR","pipeline","with","pre-trained","models",".","Args",":","transcriber","(","torch.nn.Module",")",":","transcription","network",".","predictor","(","torch.nn.Module",")",":","prediction","network",".","joiner","(","torch.nn.Module",")",":","joint","network","."]
docstr: Forward pass for training.
  
  B: batch size;
  T: maximum source sequence length in batch;
  U: maximum target sequence length in batch;
  D: feature dimension of each source sequence element.
  
  Args:
      sources (torch.Tensor): source frame sequences right-padded with right context, with
          shape `(B, T, D)`.
      source_lengths (torch.Tensor): with shape `(B,)` and i-th element representing
          number of valid frames for i-th batch element in ``sources``.
      targets (torch.Tensor): target sequences, with shape `(B, U)` and each element
          mapping to a target symbol.
      target_lengths (torch.Tensor): with shape `(B,)` and i-th element representing
          number of valid frames for i-th batch element in ``targets``.
      predictor_state (List[List[torch.Tensor]] or None, optional): list of lists of tensors
          representing prediction network internal state generated in preceding invocation
          of ``forward``. (Default: ``None``)
  
  Returns:
      (torch.Tensor, torch.Tensor, torch.Tensor, List[List[torch.Tensor]]):
          torch.Tensor
              joint network output, with shape
              `(B, max output source length, max output target length, output_dim (number of target symbols))`.
          torch.Tensor
              output source lengths, with shape `(B,)` and i-th element representing
              number of valid elements along dim 1 for i-th batch element in joint network output.
          torch.Tensor
              output target lengths, with shape `(B,)` and i-th element representing
              number of valid elements along dim 2 for i-th batch element in joint network output.
          List[List[torch.Tensor]]
              output states; list of lists of tensors
              representing prediction network internal state generated in current invocation
              of ``forward``.
docstr_tok: ["Forward","pass","for","training",".","B",":","batch","size",";","T",":","maximum","source","sequence","length","in","batch",";","U",":","maximum","target","sequence","length","in","batch",";","D",":","feature","dimension","of","each","source","sequence","element",".","Args",":","sources","(","torch.Tensor",")",":","source","frame","sequences","right-padded","with","right","context",",","with","shape","`","(","B",",","T",",","D",")","`",".","source_lengths","(","torch.Tensor",")",":","with","shape","`","(","B",",",")","`","and","i-th","element","representing","number","of","valid","frames","for","i-th","batch","element","in","``","sources","``",".","targets","(","torch.Tensor",")",":","target","sequences",",","with","shape","`","(","B",",","U",")","`","and","each","element","mapping","to","a","target","symbol",".","target_lengths","(","torch.Tensor",")",":","with","shape","`","(","B",",",")","`","and","i-th","element","representing","number","of","valid","frames","for","i-th","batch","element","in","``","targets","``",".","predictor_state","(","List","[","List","[","torch.Tensor","]","]","or","None",",","optional",")",":","list","of","lists","of","tensors","representing","prediction","network","internal","state","generated","in","preceding","invocation","of","``","forward","``",".","(","Default",":","``","None","``",")","Returns",":","(","torch.Tensor",",","torch.Tensor",",","torch.Tensor",",","List","[","List","[","torch.Tensor","]","]",")",":","torch.Tensor","joint","network","output",",","with","shape","`","(","B",",","max","output","source","length",",","max","output","target","length",",","output_dim","(","number","of","target","symbols",")",")","`",".","torch.Tensor","output","source","lengths",",","with","shape","`","(","B",",",")","`","and","i-th","element","representing","number","of","valid","elements","along","dim","1","for","i-th","batch","element","in","joint","network","output",".","torch.Tensor","output","target","lengths",",","with","shape","`","(","B",",",")","`","and","i-th","element","representing","number","of","valid","elements","along","dim","2","for","i-th","batch","element","in","joint","network","output",".","List","[","List","[","torch.Tensor","]","]","output","states",";","list","of","lists","of","tensors","representing","prediction","network","internal","state","generated","in","current","invocation","of","``","forward","``","."]
code: def forward(
      self,
      sources: torch.Tensor,
      source_lengths: torch.Tensor,
      targets: torch.Tensor,
      target_lengths: torch.Tensor,
      predictor_state: Optional[List[List[torch.Tensor]]] = None,
  ) -> Tuple[
      torch.Tensor, torch.Tensor, torch.Tensor, List[List[torch.Tensor]]
  ]:
      r"""Forward pass for training.
  
      B: batch size;
      T: maximum source sequence length in batch;
      U: maximum target sequence length in batch;
      D: feature dimension of each source sequence element.
  
      Args:
          sources (torch.Tensor): source frame sequences right-padded with right context, with
              shape `(B, T, D)`.
          source_lengths (torch.Tensor): with shape `(B,)` and i-th element representing
              number of valid frames for i-th batch element in ``sources``.
          targets (torch.Tensor): target sequences, with shape `(B, U)` and each element
              mapping to a target symbol.
          target_lengths (torch.Tensor): with shape `(B,)` and i-th element representing
              number of valid frames for i-th batch element in ``targets``.
          predictor_state (List[List[torch.Tensor]] or None, optional): list of lists of tensors
              representing prediction network internal state generated in preceding invocation
              of ``forward``. (Default: ``None``)
  
      Returns:
          (torch.Tensor, torch.Tensor, torch.Tensor, List[List[torch.Tensor]]):
              torch.Tensor
                  joint network output, with shape
                  `(B, max output source length, max output target length, output_dim (number of target symbols))`.
              torch.Tensor
                  output source lengths, with shape `(B,)` and i-th element representing
                  number of valid elements along dim 1 for i-th batch element in joint network output.
              torch.Tensor
                  output target lengths, with shape `(B,)` and i-th element representing
                  number of valid elements along dim 2 for i-th batch element in joint network output.
              List[List[torch.Tensor]]
                  output states; list of lists of tensors
                  representing prediction network internal state generated in current invocation
                  of ``forward``.
      """
      source_encodings, source_lengths = self.transcriber(
          input=sources,
          lengths=source_lengths,
      )
      (
          target_encodings,
          target_lengths,
          predictor_state,
      ) = self.predictor(
          input=targets,
          lengths=target_lengths,
          state=predictor_state,
      )
      output, source_lengths, target_lengths = self.joiner(
          source_encodings=source_encodings,
          source_lengths=source_lengths,
          target_encodings=target_encodings,
          target_lengths=target_lengths,
      )
  
      return (
          output,
          source_lengths,
          target_lengths,
          predictor_state,
      )
  
imports: from abc import ABC, abstractmethod
  from typing import List, Optional, Tuple
  import torch
  from torchaudio.models import Emformer
label_desc: Use image node_id 2 for calling the RNNT obj's underlying member method code with example usage: obj.forward(sources, source_lengths, targets, target_lengths, predictor_state) and returns: output,  source_lengths,  target_lengths,  predictor_state