class_docstr: Train Transformer for LASER task
  
  Requires --task laser
class_docstr_tok: ["Train","Transformer","for","LASER","task","Requires","--","task","laser"]
code: def build_model(cls, args, task):
      base_laser_transformer_architecture(args)
  
      num_langs = task.num_tasks if hasattr(task, "num_tasks") else 0
  
      def load_embed_tokens(dictionary, embed_dim):
          num_embeddings = len(dictionary)
          padding_idx = dictionary.pad()
  
          return Embedding(num_embeddings, embed_dim, padding_idx)
  
      encoder_embed_tokens = load_embed_tokens(
          task.source_dictionary, args.encoder_embed_dim
      )
      decoder_embed_tokens = load_embed_tokens(
          task.target_dictionary, args.decoder_embed_dim
      )
      num_langs = task.num_tasks if hasattr(task, "num_tasks") else 0
  
      encoder = LaserTransformerEncoder(
          args, task.source_dictionary, encoder_embed_tokens
      )
  
      decoder = LaserTransformerDecoder(
          args,
          task.target_dictionary,
          decoder_embed_tokens,
          num_langs=num_langs,
          lang_embed_dim=args.decoder_lang_embed_dim,
      )
  
      return cls(encoder, decoder)
  
imports: import logging
  from typing import Any, Dict, List, Optional
  from torch import Tensor
  import torch
  import torch.nn
  from fairseq.models import FairseqEncoderDecoderModel, register_model, register_model_architecture
  from fairseq.models.transformer import base_architecture, Embedding, TransformerModel, TransformerEncoder, TransformerDecoder
  from fairseq.modules import TransformerDecoderLayer
label_desc: Use image node_id 4 for calling the LaserTransformerModel obj's underlying member method code with example usage: obj.build_model(cls, args, task) and returns: cls, Embedding