class_docstr: A single transformer layer.
  
  Transformer layer takes input with size [s, b, h] and returns an
  output of the same size.
class_docstr_tok: ["A","single","transformer","layer",".","Transformer","layer","takes","input","with","size","[","s",",","b",",","h","]","and","returns","an","output","of","the","same","size","."]
docstr: Returns a function that potentially fuses the dropout and bias addition.
  
  This function is particularly helpful for the normformer architecture that does not the fused kernel after attention layers, but can after the MLP.
code: def _get_bias_droput_add_func(
      self, transformer_block_type="pre_ln", position_after="attention"
  ):
      """
      Returns a function that potentially fuses the dropout and bias addition.
  
      This function is particularly helpful for the normformer architecture that does not the fused kernel after attention layers, but can after the MLP.
      """
      # Normformer activations at this point have no bias vector since they've gone through another normalization layer.
      if (
          transformer_block_type == "normformer"
          and position_after == "attention"
      ):
          bias_dropout_add_func = get_dropout_add(self.training)
      # Bias dropout add fused kernel
      elif self.bias and self.bias_dropout_add_fusion:
          if self.training:
              bias_dropout_add_func = bias_dropout_add_fused_train
          else:
              bias_dropout_add_func = bias_dropout_add_fused_inference
      # Bias dropout add non-fused kernel
      elif self.bias and not self.bias_dropout_add_fusion:
          bias_dropout_add_func = get_bias_dropout_add(self.training)
      # Dropout add non-fused kernel for a model without bias terms.
      else:
          bias_dropout_add_func = get_dropout_add(self.training)
  
      return bias_dropout_add_func
  
imports: from contextlib import nullcontext
  from typing import Any, Callable, Optional
  import torch
  import torch.nn
  from einops import rearrange
  from nemo.collections.common.parts.adapter_modules import LinearAdapterConfig
  from nemo.collections.nlp.modules.common.megatron.adapters.parallel_adapters import AdapterName, ParallelLinearAdapterConfig, ParallelLinearAdapterWeightTyingConfig
  from nemo.collections.nlp.modules.common.megatron.attention import ParallelAttention, ParallelChunkedCrossAttention
  from nemo.collections.nlp.modules.common.megatron.fused_bias_dropout_add import bias_dropout_add, bias_dropout_add_fused_inference, bias_dropout_add_fused_train, dropout_add
  from nemo.collections.nlp.modules.common.megatron.fused_layer_norm import get_layer_norm
  from nemo.collections.nlp.modules.common.megatron.layer_norm_1p import LayerNorm1P, LPLayerNorm
  from nemo.collections.nlp.modules.common.megatron.layer_type import LayerType
  from nemo.collections.nlp.modules.common.megatron.mlp import ParallelMLP, SwitchMLP
  from nemo.collections.nlp.modules.common.megatron.module import MegatronModule
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults
  from nemo.collections.nlp.parts import utils_funcs
  from nemo.core import adapter_mixins
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling the ParallelTransformerLayer_ obj's underlying member method code with example usage: obj._get_bias_droput_add_func(transformer_block_type, position_after) and returns: bias_dropout_add_func