class_docstr: Latent depth (https://arxiv.org/abs/2009.13102) implemented in
  TransformerDecoder.
class_docstr_tok: ["Latent","depth","(","https",":","\/\/arxiv.org\/abs\/2009.13102",")","implemented","in","TransformerDecoder","."]
code: def forward(
      self,
      prev_output_tokens,
      encoder_out: Optional[EncoderOut] = None,
      incremental_state: Optional[
          Dict[str, Dict[str, Optional[Tensor]]]
      ] = None,
      features_only: bool = False,
      alignment_layer: Optional[int] = None,
      alignment_heads: Optional[int] = None,
      src_lengths: Optional[Any] = None,
      return_all_hiddens: bool = False,
  ):
      self.layer_select.sample(self.lang_idx)
      return super().forward(
          prev_output_tokens=prev_output_tokens,
          encoder_out=encoder_out,
          incremental_state=incremental_state,
          features_only=features_only,
          alignment_layer=alignment_layer,
          src_lengths=src_lengths,
          return_all_hiddens=return_all_hiddens,
      )
  
imports: from typing import Any, Dict, Optional
  import torch.nn
  from fairseq.models.fairseq_encoder import EncoderOut
  from fairseq.models.transformer import TransformerDecoder, TransformerEncoder
  from fairseq.modules import TransformerDecoderLayer, TransformerEncoderLayer
  from torch import Tensor
  from ..modules.latent_layers import LayerSelect
label_desc: Use image node_id 4 for calling the LatentTransformerDecoder obj's underlying member method code with example usage: obj.forward(prev_output_tokens, encoder_out, incremental_state, features_only, alignment_layer, alignment_heads, src_lengths, return_all_hiddens) and returns: super