class_docstr: Custom decoder module for Transducer model.
  
  Args:
      odim: Output dimension.
      dec_arch: Decoder block architecture (type and parameters).
      input_layer: Input layer type.
      repeat_block: Number of times dec_arch is repeated.
      joint_activation_type: Type of activation for joint network.
      positional_encoding_type: Positional encoding type.
      positionwise_layer_type: Positionwise layer type.
      positionwise_activation_type: Positionwise activation type.
      input_layer_dropout_rate: Dropout rate for input layer.
      blank_id: Blank symbol ID.
class_docstr_tok: ["Custom","decoder","module","for","Transducer","model",".","Args",":","odim",":","Output","dimension",".","dec_arch",":","Decoder","block","architecture","(","type","and","parameters",")",".","input_layer",":","Input","layer","type",".","repeat_block",":","Number","of","times","dec_arch","is","repeated",".","joint_activation_type",":","Type","of","activation","for","joint","network",".","positional_encoding_type",":","Positional","encoding","type",".","positionwise_layer_type",":","Positionwise","layer","type",".","positionwise_activation_type",":","Positionwise","activation","type",".","input_layer_dropout_rate",":","Dropout","rate","for","input","layer",".","blank_id",":","Blank","symbol","ID","."]
docstr: Get specified ID state from decoder hidden states.
  
  Args:
      states: Decoder hidden states. [N x (B, U, D_dec)]
      idx: State ID to extract.
  
  Returns:
      state_idx: Decoder hidden state for given ID. [N x (1, U, D_dec)]
docstr_tok: ["Get","specified","ID","state","from","decoder","hidden","states",".","Args",":","states",":","Decoder","hidden","states",".","[","N","x","(","B",",","U",",","D_dec",")","]","idx",":","State","ID","to","extract",".","Returns",":","state_idx",":","Decoder","hidden","state","for","given","ID",".","[","N","x","(","1",",","U",",","D_dec",")","]"]
code: def select_state(
      self, states: List[Optional[torch.Tensor]], idx: int
  ) -> List[Optional[torch.Tensor]]:
      """Get specified ID state from decoder hidden states.
  
      Args:
          states: Decoder hidden states. [N x (B, U, D_dec)]
          idx: State ID to extract.
  
      Returns:
          state_idx: Decoder hidden state for given ID. [N x (1, U, D_dec)]
  
      """
      if states[0] is None:
          return states
  
      state_idx = [states[layer][idx] for layer in range(self.dlayers)]
  
      return state_idx
  
file_path: espnet/espnet/nets/pytorch_backend/transducer/custom_decoder.py
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  import torch
  from espnet.nets.pytorch_backend.transducer.blocks import build_blocks
  from espnet.nets.pytorch_backend.transducer.utils import check_batch_states, check_state, pad_sequence
  from espnet.nets.pytorch_backend.transformer.layer_norm import LayerNorm
  from espnet.nets.pytorch_backend.transformer.mask import subsequent_mask
  from espnet.nets.transducer_decoder_interface import ExtendedHypothesis, Hypothesis, TransducerDecoderInterface
label_desc: Use image node_id 7 for calling the CustomDecoder obj's underlying member method code with example usage: obj.select_state(states, idx) and returns: state_idx, states