class_docstr: RNN decoder module for Transducer model.
  
  Args:
      odim: Output dimension.
      dtype: Decoder units type.
      dlayers: Number of decoder layers.
      dunits: Number of decoder units per layer..
      embed_dim: Embedding layer dimension.
      dropout_rate: Dropout rate for decoder layers.
      dropout_rate_embed: Dropout rate for embedding layer.
      blank_id: Blank symbol ID.
class_docstr_tok: ["RNN","decoder","module","for","Transducer","model",".","Args",":","odim",":","Output","dimension",".","dtype",":","Decoder","units","type",".","dlayers",":","Number","of","decoder","layers",".","dunits",":","Number","of","decoder","units","per","layer","..","embed_dim",":","Embedding","layer","dimension",".","dropout_rate",":","Dropout","rate","for","decoder","layers",".","dropout_rate_embed",":","Dropout","rate","for","embedding","layer",".","blank_id",":","Blank","symbol","ID","."]
docstr: One-step forward hypothesis.
  
  Args:
      hyp: Hypothesis.
      cache: Pairs of (dec_out, state) for each label sequence. (key)
  
  Returns:
      dec_out: Decoder output sequence. (1, D_dec)
      new_state: Decoder hidden states. ((N, 1, D_dec), (N, 1, D_dec))
      label: Label ID for LM. (1,)
docstr_tok: ["One-step","forward","hypothesis",".","Args",":","hyp",":","Hypothesis",".","cache",":","Pairs","of","(","dec_out",",","state",")","for","each","label","sequence",".","(","key",")","Returns",":","dec_out",":","Decoder","output","sequence",".","(","1",",","D_dec",")","new_state",":","Decoder","hidden","states",".","(","(","N",",","1",",","D_dec",")",",","(","N",",","1",",","D_dec",")",")","label",":","Label","ID","for","LM",".","(","1",",",")"]
code: def score(
      self, hyp: Hypothesis, cache: Dict[str, Any]
  ) -> Tuple[
      torch.Tensor,
      Tuple[torch.Tensor, Optional[torch.Tensor]],
      torch.Tensor,
  ]:
      """One-step forward hypothesis.
  
      Args:
          hyp: Hypothesis.
          cache: Pairs of (dec_out, state) for each label sequence. (key)
  
      Returns:
          dec_out: Decoder output sequence. (1, D_dec)
          new_state: Decoder hidden states. ((N, 1, D_dec), (N, 1, D_dec))
          label: Label ID for LM. (1,)
  
      """
      label = torch.full(
          (1, 1), hyp.yseq[-1], dtype=torch.long, device=self.device
      )
  
      str_labels = "_".join(list(map(str, hyp.yseq)))
  
      if str_labels in cache:
          dec_out, dec_state = cache[str_labels]
      else:
          dec_emb = self.embed(label)
  
          dec_out, dec_state = self.rnn_forward(dec_emb, hyp.dec_state)
          cache[str_labels] = (dec_out, dec_state)
  
      return dec_out[0][0], dec_state, label[0]
  
file_path: espnet/espnet/nets/pytorch_backend/transducer/rnn_decoder.py
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  import torch
  from espnet.nets.transducer_decoder_interface import ExtendedHypothesis, Hypothesis, TransducerDecoderInterface
label_desc: Use image node_id 6 for calling the RNNDecoder obj's underlying member method code with example usage: obj.score(hyp, cache) and returns: dec_out,  dec_state,  label