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: Get specified ID state from decoder hidden states.
  
  Args:
      states: Decoder hidden states. ((N, B, D_dec), (N, B, D_dec))
      idx: State ID to extract.
  
  Returns:
      : Decoder hidden state for given ID.
        ((N, 1, D_dec), (N, 1, D_dec))
docstr_tok: ["Get","specified","ID","state","from","decoder","hidden","states",".","Args",":","states",":","Decoder","hidden","states",".","(","(","N",",","B",",","D_dec",")",",","(","N",",","B",",","D_dec",")",")","idx",":","State","ID","to","extract",".","Returns",":",":","Decoder","hidden","state","for","given","ID",".","(","(","N",",","1",",","D_dec",")",",","(","N",",","1",",","D_dec",")",")"]
code: def select_state(
      self,
      states: Tuple[torch.Tensor, Optional[torch.Tensor]],
      idx: int,
  ) -> Tuple[torch.Tensor, Optional[torch.Tensor]]:
      """Get specified ID state from decoder hidden states.
  
      Args:
          states: Decoder hidden states. ((N, B, D_dec), (N, B, D_dec))
          idx: State ID to extract.
  
      Returns:
          : Decoder hidden state for given ID.
            ((N, 1, D_dec), (N, 1, D_dec))
  
      """
      return (
          states[0][:, idx : idx + 1, :],
          states[1][:, idx : idx + 1, :]
          if self.dtype == "lstm"
          else None,
      )
  
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 8 for calling the RNNDecoder obj's underlying member method code with example usage: obj.select_state(states, idx) and returns: states,  unknown