class_docstr: A task for multiple translation with latent depth.
  
  See `"Deep Transformer with Latent Depth"
      (Li et al., 2020) <https://arxiv.org/pdf/2009.13102.pdf>`_.
code: def __init__(self, args, dicts, training):
      super().__init__(args, dicts, training)
      self.src_langs, self.tgt_langs = zip(
          *[
              (lang.split("-")[0], lang.split("-")[1])
              for lang in args.lang_pairs
          ]
      )
      if self.training and self.encoder_latent_layer:
          assert self.args.share_encoders
      if self.training and self.decoder_latent_layer:
          assert self.args.share_decoders
      if (
          training
          or self.encoder_latent_layer
          or self.decoder_latent_layer
      ):
          self.lang_pairs = args.lang_pairs
      else:
          self.lang_pairs = [
              "{}-{}".format(args.source_lang, args.target_lang)
          ]
      self.eval_lang_pairs = self.lang_pairs
      self.model_lang_pairs = self.lang_pairs
      if self.training and (
          self.encoder_latent_layer or self.decoder_latent_layer
      ):
          self.kl_loss = LatentLayersKLLoss(self.args)
          self.sparsity_loss = LatentLayersSparsityLoss(self.args)
  
file_path: fairseq/examples/latent_depth/latent_depth_src/multilingual_translation_latent_depth.py
imports: from fairseq.tasks import register_task
  from fairseq.tasks.multilingual_translation import MultilingualTranslationTask
  from fairseq.utils import safe_hasattr
  from .loss.latent_depth import LatentLayersKLLoss, LatentLayersSparsityLoss
label_desc: Use image node_id 2 to create a new MultilingualTranslationTaskLatentDepth object from inherited base classes: MultilingualTranslationTask with example: obj = MultilingualTranslationTaskLatentDepth(args, dicts, training)