class_docstr: Implementation of a parallel bottleneck adapter block.
docstr: Performs computations after the forward pass of the adapter block(s). This e.g. includes applying the residual
  connection and layer norm if configured in this way.
  
  Args:
      hidden_states: The hidden states outputted by the adapter block(s).
      input_hidden_states: Residual connection before the adapter block(s).
      input_tensor: Residual connection before the Transformer FFN/ attention layer.
      layer_norm: Transformer LayerNorm.
  
  Returns:
      The modified hidden states.
docstr_tok: ["Performs","computations","after","the","forward","pass","of","the","adapter","block","(","s",")",".","This","e.g",".","includes","applying","the","residual","connection","and","layer","norm","if","configured","in","this","way",".","Args",":","hidden_states",":","The","hidden","states","outputted","by","the","adapter","block","(","s",")",".","input_hidden_states",":","Residual","connection","before","the","adapter","block","(","s",")",".","input_tensor",":","Residual","connection","before","the","Transformer","FFN\/","attention","layer",".","layer_norm",":","Transformer","LayerNorm",".","Returns",":","The","modified","hidden","states","."]
code: def post_forward(
      self, hidden_states, input_hidden_states, input_tensor, layer_norm
  ):
      """
      Performs computations after the forward pass of the adapter block(s). This e.g. includes applying the residual
      connection and layer norm if configured in this way.
  
      Args:
          hidden_states: The hidden states outputted by the adapter block(s).
          input_hidden_states: Residual connection before the adapter block(s).
          input_tensor: Residual connection before the Transformer FFN/ attention layer.
          layer_norm: Transformer LayerNorm.
  
      Returns:
          The modified hidden states.
      """
      hidden_states = hidden_states + input_hidden_states
  
      if self.original_ln_after:
          if layer_norm:
              hidden_states = layer_norm(hidden_states + input_tensor)
          else:
              hidden_states = hidden_states + input_tensor
  
      return hidden_states
  
imports: import math
  import torch
  from torch import nn
  from transformers.activations import get_activation
  from ..configuration import AdapterFusionConfig, BnConfig
  from ..context import ForwardContext
label_desc: Use image node_id 4 for calling the ParallelAdapter obj's underlying member method code with example usage: obj.post_forward(hidden_states, input_hidden_states, input_tensor, layer_norm) and returns: hidden_states