class_docstr: Decoder with general structure of Chen et al., The Best of Both Worlds:
  Combining Recent Advances in Neural Machine Translation, 2018.
  https://arxiv.org/abs/1804.09849
class_docstr_tok: ["Decoder","with","general","structure","of","Chen","et","al.",",","The","Best","of","Both","Worlds",":","Combining","Recent","Advances","in","Neural","Machine","Translation",",","2018.","https",":","\/\/arxiv.org\/abs\/1804.09849"]
code: def _init_components(self, args, src_dict, dst_dict, embed_tokens):
      self.initial_rnn_layer = nn.LSTM(
          input_size=self.initial_input_dim, hidden_size=self.lstm_units
      )
  
      self.proj_encoder_layer = None
      if self.attention_dim != self.encoder_output_dim:
          self.proj_encoder_layer = fairseq_transformer.Linear(
              self.encoder_output_dim, self.attention_dim
          )
  
      self.proj_layer = None
      if self.lstm_units != self.attention_dim:
          self.proj_layer = fairseq_transformer.Linear(
              self.lstm_units, self.attention_dim
          )
  
      self.attention = MultiheadAttention(
          self.attention_dim,
          self.num_attention_heads,
          dropout=args.attention_dropout,
          encoder_decoder_attention=True,
      )
  
      self.extra_rnn_layers = nn.ModuleList([])
      for _ in range(self.num_layers - 1):
          self.extra_rnn_layers.append(
              nn.LSTM(
                  input_size=self.input_dim, hidden_size=self.lstm_units
              )
          )
  
      self.bottleneck_layer = None
      if self.bottleneck_dim is not None:
          self.out_embed_dim = self.bottleneck_dim
          self.bottleneck_layer = fairseq_transformer.Linear(
              self.input_dim, self.out_embed_dim
          )
      else:
          self.out_embed_dim = self.input_dim
  
      self.embed_out = nn.Parameter(
          torch.Tensor(len(dst_dict), self.out_embed_dim)
      )
      nn.init.normal_(
          self.embed_out, mean=0, std=self.out_embed_dim**-0.5
      )
  
      self.vocab_reduction_module = None
      if args.vocab_reduction_params:
          self.vocab_reduction_module = vocab_reduction.VocabReduction(
              src_dict,
              dst_dict,
              args.vocab_reduction_params,
              fp16=args.fp16,
          )
  
      self.onnx_trace = False
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import utils
  from fairseq.models import FairseqEncoderDecoderModel, FairseqIncrementalDecoder, register_model, register_model_architecture, transformer
  from fairseq.modules import MultiheadAttention
  from pytorch_translate import multilingual_model, transformer, vocab_reduction
  from pytorch_translate.utils import torch_find
label_desc: Use image node_id 2 for calling the HybridRNNDecoder obj's underlying member method code with example usage: obj._init_components(args, src_dict, dst_dict, embed_tokens) without return types