class_docstr: (RNN-)Transducer decoder module.
  
  Args:
      vocab_size: Output dimension.
      layers_type: (RNN-)Decoder layers type.
      num_layers: Number of decoder layers.
      hidden_size: Number of decoder units per layer.
      dropout: Dropout rate for decoder layers.
      dropout_embed: Dropout rate for embedding layer.
      embed_pad: Embed/Blank symbol ID.
docstr: Encode source label sequences.
  
  Args:
      sequence: RNN input sequences. (B, D_emb)
      state: Decoder hidden states. ((N, B, D_dec), (N, B, D_dec))
  
  Returns:
      sequence: RNN output sequences. (B, D_dec)
      (h_next, c_next): Decoder hidden states. (N, B, D_dec), (N, B, D_dec))
docstr_tok: ["Encode","source","label","sequences",".","Args",":","sequence",":","RNN","input","sequences",".","(","B",",","D_emb",")","state",":","Decoder","hidden","states",".","(","(","N",",","B",",","D_dec",")",",","(","N",",","B",",","D_dec",")",")","Returns",":","sequence",":","RNN","output","sequences",".","(","B",",","D_dec",")","(","h_next",",","c_next",")",":","Decoder","hidden","states",".","(","N",",","B",",","D_dec",")",",","(","N",",","B",",","D_dec",")",")"]
code: def rnn_forward(
      self,
      sequence: torch.Tensor,
      state: Tuple[torch.Tensor, Optional[torch.Tensor]],
  ) -> Tuple[torch.Tensor, Tuple[torch.Tensor, Optional[torch.Tensor]]]:
      """Encode source label sequences.
  
      Args:
          sequence: RNN input sequences. (B, D_emb)
          state: Decoder hidden states. ((N, B, D_dec), (N, B, D_dec))
  
      Returns:
          sequence: RNN output sequences. (B, D_dec)
          (h_next, c_next): Decoder hidden states. (N, B, D_dec), (N, B, D_dec))
  
      """
      h_prev, c_prev = state
      h_next, c_next = self.init_state(sequence.size(0))
  
      for layer in range(self.dlayers):
          if self.dtype == "lstm":
              (
                  sequence,
                  (
                      h_next[layer : layer + 1],
                      c_next[layer : layer + 1],
                  ),
              ) = self.decoder[layer](
                  sequence,
                  hx=(
                      h_prev[layer : layer + 1],
                      c_prev[layer : layer + 1],
                  ),
              )
          else:
              sequence, h_next[layer : layer + 1] = self.decoder[layer](
                  sequence, hx=h_prev[layer : layer + 1]
              )
  
          sequence = self.dropout_dec[layer](sequence)
  
      return sequence, (h_next, c_next)
  
file_path: espnet/espnet2/asr/decoder/transducer_decoder.py
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  import torch
  from typeguard import check_argument_types
  from espnet2.asr.decoder.abs_decoder import AbsDecoder
  from espnet2.asr.transducer.beam_search_transducer import ExtendedHypothesis, Hypothesis
label_desc: Use image node_id 4 for calling the TransducerDecoder obj's underlying member method code with example usage: obj.rnn_forward(sequence, state) and returns: sequence,  h_next,  c_next