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 _per_lang_pair_valid_loss(
      self, lang_pair, model, criterion, sample
  ):
      src, tgt = lang_pair.split("-")
      if self.encoder_latent_layer:
          src_lang_idx = self.src_lang_idx_dict[src]
          model.models[lang_pair].encoder.set_lang_idx(src_lang_idx)
      if self.decoder_latent_layer:
          tgt_lang_idx = self.tgt_lang_idx_dict[tgt]
          model.models[lang_pair].decoder.set_lang_idx(tgt_lang_idx)
      loss, sample_size, logging_output = criterion(
          model.models[lang_pair], sample[lang_pair]
      )
      return loss, sample_size, logging_output
  
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 5 for calling the MultilingualTranslationTaskLatentDepth obj's underlying member method code with example usage: obj._per_lang_pair_valid_loss(lang_pair, model, criterion, sample) and returns: loss,  sample_size,  logging_output