code: def build_model(cls, args, task):
      src_dict, tgt_dict = (
          task.source_dictionary,
          task.target_dictionary,
      )
      if args.share_all_embeddings:
          if src_dict != tgt_dict:
              raise ValueError(
                  "--share-all-embeddings requires a joined dictionary"
              )
          if args.encoder_embed_dim != args.decoder_embed_dim:
              raise ValueError(
                  "--share-all-embeddings requires --encoder-embed-dim to match --decoder-embed-dim"
              )
          encoder_embed_tokens = cls.build_embedding(
              args,
              src_dict,
              args.encoder_embed_dim,
              args.max_source_positions,
          )
          decoder_embed_tokens = cls.build_embedding(
              args,
              tgt_dict,
              args.decoder_embed_dim,
              args.max_target_positions,
              emb_lookup=encoder_embed_tokens,
          )
          args.share_decoder_input_output_embed = True
      else:
          encoder_embed_tokens = cls.build_embedding(
              args,
              src_dict,
              args.encoder_embed_dim,
              args.max_source_positions,
          )
          decoder_embed_tokens = cls.build_embedding(
              args,
              tgt_dict,
              args.decoder_embed_dim,
              args.max_target_positions,
          )
  
      encoder = cls.build_encoder(args, src_dict, encoder_embed_tokens)
      decoder = cls.build_decoder(args, tgt_dict, decoder_embed_tokens)
  
      if args.enable_quant:
          if args.use_torch_layer:
              if args.quant_mode == "qat":
                  encoder.apply(qat_mode)
                  decoder.apply(qat_mode)
              elif args.quant_mode == "ptq":
                  encoder.apply(ptq_mode)
                  decoder.apply(ptq_mode)
          else:
              if args.quant_mode == "qat":
                  encoder.apply(enable_quant)
                  decoder.apply(enable_quant)
                  encoder.apply(qat_mode)
                  decoder.apply(qat_mode)
  
              else:
                  raise NotImplementedError
      else:
          encoder.apply(disable_quant)
          decoder.apply(disable_quant)
  
      return cls(args, encoder, decoder)
  
imports: import torch
  import torch.nn
  from fairseq import utils
  from fairseq.models import FairseqEncoder, FairseqEncoderDecoderModel, FairseqIncrementalDecoder, register_model, register_model_architecture
  from fairseq.models.fairseq_encoder import EncoderOut
  from fairseq.modules import LayerNorm
  from lightseq.training.ops.pytorch.layer_base import TransformerEmbeddingLayerBase
  from lightseq.training.ops.pytorch.quantization import QuantLinear, disable_quant, enable_quant, ptq_mode, qat_mode
label_desc: Use image node_id 3 for calling the LSTransformerModel obj's underlying member method code with example usage: obj.build_model(cls, args, task) and returns: cls