class_docstr: RNN decoder module.
  
  Args:
      vocab_size: Vocabulary size.
      embed_size: Embedding size.
      hidden_size: Hidden size..
      rnn_type: Decoder layers type.
      num_layers: Number of decoder layers.
      dropout_rate: Dropout rate for decoder layers.
      embed_dropout_rate: Dropout rate for embedding layer.
      embed_pad: Embedding padding symbol ID.
docstr: One-step forward hypothesis.
  
  Args:
      label_sequence: Current label sequence.
      states: Decoder hidden states.
                ((N, 1, D_dec), (N, 1, D_dec) or None)
  
  Returns:
      out: Decoder output sequence. (1, D_dec)
      states: Decoder hidden states.
                ((N, 1, D_dec), (N, 1, D_dec) or None)
docstr_tok: ["One-step","forward","hypothesis",".","Args",":","label_sequence",":","Current","label","sequence",".","states",":","Decoder","hidden","states",".","(","(","N",",","1",",","D_dec",")",",","(","N",",","1",",","D_dec",")","or","None",")","Returns",":","out",":","Decoder","output","sequence",".","(","1",",","D_dec",")","states",":","Decoder","hidden","states",".","(","(","N",",","1",",","D_dec",")",",","(","N",",","1",",","D_dec",")","or","None",")"]
code: def score(
      self,
      label_sequence: List[int],
      states: Tuple[torch.Tensor, Optional[torch.Tensor]],
  ) -> Tuple[torch.Tensor, Tuple[torch.Tensor, Optional[torch.Tensor]]]:
      """One-step forward hypothesis.
  
      Args:
          label_sequence: Current label sequence.
          states: Decoder hidden states.
                    ((N, 1, D_dec), (N, 1, D_dec) or None)
  
      Returns:
          out: Decoder output sequence. (1, D_dec)
          states: Decoder hidden states.
                    ((N, 1, D_dec), (N, 1, D_dec) or None)
  
      """
      str_labels = "_".join(map(str, label_sequence))
  
      if str_labels in self.score_cache:
          out, states = self.score_cache[str_labels]
      else:
          label = torch.full(
              (1, 1),
              label_sequence[-1],
              dtype=torch.long,
              device=self.device,
          )
  
          embed = self.embed(label)
          out, states = self.rnn_forward(embed, states)
  
          self.score_cache[str_labels] = (out, states)
  
      return out[0], states
  
file_path: espnet/espnet2/asr_transducer/decoder/rnn_decoder.py
imports: from typing import List, Optional, Tuple
  import torch
  from typeguard import check_argument_types
  from espnet2.asr_transducer.beam_search_transducer import Hypothesis
  from espnet2.asr_transducer.decoder.abs_decoder import AbsDecoder
label_desc: Use image node_id 4 for calling the RNNDecoder obj's underlying member method code with example usage: obj.score(label_sequence, states) and returns: out,  states