class_docstr: Multilingual encoder.
  
  This encoder consists of n separate encoders. A language token ID at the
  begin of the source sentence selects the encoder to use.
class_docstr_tok: ["Multilingual","encoder",".","This","encoder","consists","of","n","separate","encoders",".","A","language","token","ID","at","the","begin","of","the","source","sentence","selects","the","encoder","to","use","."]
code: def __init__(
      self,
      dictionary,
      encoders,
      hidden_dim,
      num_layers,
      embed_dim,
      rescale_grads=False,
  ):
      super().__init__(dictionary)
      self.dictionary = dictionary
      self.encoders = nn.ModuleList(encoders)
      self.hidden_dim = hidden_dim
      self.num_layers = num_layers
      self.word_dim = embed_dim
      if rescale_grads and len(encoders) > 1:
          register_hooks(self, encoders)
  
imports: import torch
  import torch.nn
  from fairseq.models import FairseqEncoder, FairseqIncrementalDecoder
  from pytorch_translate import utils
  from pytorch_translate.data import data
label_desc: Use image node_id 1 to create a new MultilingualEncoder object from inherited base classes: FairseqEncoder with example: obj = MultilingualEncoder(dictionary, encoders, hidden_dim, num_layers, embed_dim, rescale_grads)