docstr: Build a new model instance.
docstr_tok: ["Build","a","new","model","instance","."]
code: def build_model(cls, args, task):
      """Build a new model instance."""
      # make sure that all args are properly defaulted
      # (in case there are any new ones)
      base_architecture(args)
  
      src_dict, tgt_dict = (
          task.source_dictionary,
          task.target_dictionary,
      )
  
      encoder_embed_tokens = (
          pytorch_translate_transformer.build_embedding(
              dictionary=src_dict,
              embed_dim=args.encoder_embed_dim,
              path=args.encoder_pretrained_embed,
              freeze=args.encoder_freeze_embed,
          )
      )
  
      teacher_decoder_embed_tokens = (
          pytorch_translate_transformer.build_embedding(
              dictionary=tgt_dict, embed_dim=args.decoder_embed_dim
          )
      )
  
      student_decoder_embed_tokens = (
          pytorch_translate_transformer.build_embedding(
              dictionary=tgt_dict,
              embed_dim=args.student_decoder_embed_dim,
          )
      )
  
      encoder = pytorch_translate_transformer.TransformerEncoder(
          args, src_dict, encoder_embed_tokens, proj_to_decoder=False
      )
  
      teacher_decoder = hybrid_transformer_rnn.HybridRNNDecoder(
          args, src_dict, tgt_dict, teacher_decoder_embed_tokens
      )
  
      student_decoder = StudentHybridRNNDecoder(
          args, src_dict, tgt_dict, student_decoder_embed_tokens
      )
  
      return HybridDualDecoderKDModel(
          task=task,
          encoder=encoder,
          teacher_decoder=teacher_decoder,
          student_decoder=student_decoder,
      )
  
file_path: translate/pytorch_translate/research/knowledge_distillation/hybrid_dual_decoder_kd_model.py
imports: from fairseq.models import FairseqEncoderDecoderModel, register_model, register_model_architecture
  from pytorch_translate import hybrid_transformer_rnn, transformer
  from pytorch_translate.utils import torch_find
label_desc: Use image node_id 5 for calling the HybridDualDecoderKDModel obj's underlying member method code with example usage: obj.build_model(cls, args, task) and returns: HybridDualDecoderKDModel