docstr: Builds encoder and decoder token embeddings. If pretrained embeddings
  are specified, load them.
docstr_tok: ["Builds","encoder","and","decoder","token","embeddings",".","If","pretrained","embeddings","are","specified",",","load","them","."]
code: def build_embed_tokens(cls, args, src_dict, dst_dict):
      """Builds encoder and decoder token embeddings. If pretrained embeddings
      are specified, load them."""
      encoder_embed_tokens = Embedding(
          num_embeddings=len(src_dict),
          embedding_dim=args.encoder_embed_dim,
          padding_idx=src_dict.pad(),
          freeze_embed=args.encoder_freeze_embed,
          normalize_embed=args.encoder_normalize_embed,
      )
      pytorch_translate_utils.load_embedding(
          embedding=encoder_embed_tokens,
          dictionary=src_dict,
          pretrained_embed=args.encoder_pretrained_embed,
      )
      decoder_embed_tokens = Embedding(
          num_embeddings=len(dst_dict),
          embedding_dim=args.decoder_embed_dim,
          padding_idx=dst_dict.pad(),
          freeze_embed=args.decoder_freeze_embed,
      )
  
      pytorch_translate_utils.load_embedding(
          embedding=decoder_embed_tokens,
          dictionary=dst_dict,
          pretrained_embed=args.decoder_pretrained_embed,
      )
      return encoder_embed_tokens, decoder_embed_tokens
  
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.onnx.operators
  from fairseq import options, utils
  from fairseq.models import FairseqEncoder, FairseqEncoderDecoderModel, register_model, register_model_architecture
  from fairseq.modules import AdaptiveSoftmax
  from pytorch_translate import attention, rnn_cell, utils, vocab_reduction
  from pytorch_translate.common_layers import ContextEmbedding, DecoderWithOutputProjection, Embedding, Linear, RNNLayer, VariableTracker
  from pytorch_translate.data import data
  from pytorch_translate.multi_model import MultiDecoder, MultiEncoder
  from pytorch_translate.multilingual import MultilingualDecoder, MultilingualEncoder
  from pytorch_translate.ngram import NGramDecoder
  from pytorch_translate.semi_supervised import SemiSupervisedModel
  from pytorch_translate.utils import maybe_cat, maybe_cuda, torch_find
  from torch.nn.utils.rnn import pack_padded_sequence, PackedSequence, pad_packed_sequence
label_desc: Use image node_id 5 for calling the RNNModel obj's underlying member method code with example usage: obj.build_embed_tokens(cls, args, src_dict, dst_dict) and returns: encoder_embed_tokens,  decoder_embed_tokens