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 inference_step(
      self,
      generator,
      models,
      sample,
      prefix_tokens=None,
      constraints=None,
  ):
      if self.encoder_latent_layer or self.decoder_latent_layer:
          for model in models:
              if self.encoder_latent_layer:
                  assert model.encoder.layer_select is not None
                  src_lang_idx = self.src_lang_idx_dict[
                      self.args.source_lang
                  ]
                  model.encoder.set_lang_idx(src_lang_idx)
              if self.decoder_latent_layer:
                  assert model.decoder.layer_select is not None
                  tgt_lang_idx = self.tgt_lang_idx_dict[
                      self.args.target_lang
                  ]
                  model.decoder.set_lang_idx(tgt_lang_idx)
      return super().inference_step(
          generator, models, sample, prefix_tokens, constraints
      )
  
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 6 for calling the MultilingualTranslationTaskLatentDepth obj's underlying member method code with example usage: obj.inference_step(generator, models, sample, prefix_tokens, constraints) and returns: super