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: Transducer initializer.
docstr_tok: ["Transducer","initializer","."]
code: def __init__(
      self,
      odim: int,
      dtype: str,
      dlayers: int,
      dunits: int,
      embed_dim: int,
      dropout_rate: float = 0.0,
      dropout_rate_embed: float = 0.0,
      blank_id: int = 0,
  ):
      """Transducer initializer."""
      super().__init__()
  
      self.embed = torch.nn.Embedding(
          odim, embed_dim, padding_idx=blank_id
      )
      self.dropout_embed = torch.nn.Dropout(p=dropout_rate_embed)
  
      dec_net = torch.nn.LSTM if dtype == "lstm" else torch.nn.GRU
  
      self.decoder = torch.nn.ModuleList(
          [dec_net(embed_dim, dunits, 1, batch_first=True)]
      )
      self.dropout_dec = torch.nn.Dropout(p=dropout_rate)
  
      for _ in range(1, dlayers):
          self.decoder += [dec_net(dunits, dunits, 1, batch_first=True)]
  
      self.dlayers = dlayers
      self.dunits = dunits
      self.dtype = dtype
  
      self.odim = odim
  
      self.ignore_id = -1
      self.blank_id = blank_id
  
      self.multi_gpus = torch.cuda.device_count() > 1
  
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 1 to create a new RNNDecoder object from inherited base classes: TransducerDecoderInterface, torch.nn with example: obj = RNNDecoder(odim, dtype, dlayers, dunits, embed_dim, dropout_rate, dropout_rate_embed, blank_id)