class_docstr: Decoder layer with each (non_residual) block weighted by samples of Bernouli
  or Gumbel Signmoid samples.
  
  Args:
      args (argparse.Namespace): parsed command-line arguments from standard
          TransformerDecoderLayer.
      idx (int): layer index (used to retrieve samples).
      layer_select (LayerSelect, optional): instance of LayerSelect module with logits
          parameters and sampling method.
      no_encoder_attn (bool, optional): whether to attend to encoder outputs
          (default: False).
class_docstr_tok: ["Decoder","layer","with","each","(","non_residual",")","block","weighted","by","samples","of","Bernouli","or","Gumbel","Signmoid","samples",".","Args",":","args","(","argparse.Namespace",")",":","parsed","command-line","arguments","from","standard","TransformerDecoderLayer",".","idx","(","int",")",":","layer","index","(","used","to","retrieve","samples",")",".","layer_select","(","LayerSelect",",","optional",")",":","instance","of","LayerSelect","module","with","logits","parameters","and","sampling","method",".","no_encoder_attn","(","bool",",","optional",")",":","whether","to","attend","to","encoder","outputs","(","default",":","False",")","."]
code: def residual_connection(self, x, residual):
      return residual + x * self.layer_select(self.idx)
  
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 2 for calling the LatentTransformerDecoderLayer obj's underlying member method code with example usage: obj.residual_connection(x, residual) and returns: unknown