code: def build_multitask_decoder(
      cls,
      args,
      mtl_args,
      tgt_dict,
      in_dim,
      is_first_pass_decoder=False,
  ):
      decoder_args = mtl_args.decoder_args
      decoder_args.encoder_embed_dim = in_dim
      if mtl_args.decoder_type == "transformer":
          if is_first_pass_decoder:
              task_decoder = cls.build_text_decoder(args, tgt_dict)
          else:
              from fairseq.models.speech_to_speech import (
                  base_multitask_text_transformer_decoder_arch,
              )
  
              base_multitask_text_transformer_decoder_arch(
                  decoder_args
              )  # 2L
              task_decoder = TransformerDecoder(
                  decoder_args,
                  tgt_dict,
                  embed_tokens=TransformerModelBase.build_embedding(
                      decoder_args,
                      tgt_dict,
                      decoder_args.decoder_embed_dim,
                  ),
              )
      elif mtl_args.decoder_type == "ctc":
          task_decoder = CTCDecoder(
              dictionary=tgt_dict,
              in_dim=in_dim,
          )
      else:
          raise NotImplementedError(
              "currently only support multitask decoder_type 'transformer', 'ctc'"
          )
  
      return task_decoder
  
imports: import copy
  import logging
  from typing import Dict, List, Optional, Tuple
  import numpy
  import torch
  import torch.nn
  from torch import Tensor
  from fairseq import checkpoint_utils, utils
  from fairseq.data.data_utils import lengths_to_padding_mask
  from fairseq.models import FairseqEncoder, FairseqEncoderDecoderModel, FairseqEncoderModel, FairseqLanguageModel, register_model, register_model_architecture
  from fairseq.models.speech_to_speech.modules.ctc_decoder import CTCDecoder
  from fairseq.models.speech_to_text.hub_interface import S2THubInterface
  from fairseq.models.transformer import Embedding, TransformerDecoder, TransformerModelBase
  from fairseq.models.wav2vec import Wav2VecEncoder
  from fairseq.modules.layer_norm import LayerNorm
label_desc: Use image node_id 11 for calling the XMTransformerModel obj's underlying member method code with example usage: obj.build_multitask_decoder(cls, args, mtl_args, tgt_dict, in_dim, is_first_pass_decoder) and returns: task_decoder