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: 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/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 8 for calling the TransducerDecoder obj's underlying member method code with example usage: obj.select_state(states, idx) and returns: states,  unknown