class_docstr: MLP.
  
  MLP will take the input with h hidden state, project it to 4*h
  hidden dimension, perform nonlinear transformation, and project the
  state back into h hidden dimension.
class_docstr_tok: ["MLP",".","MLP","will","take","the","input","with","h","hidden","state",",","project","it","to","4","*","h","hidden","dimension",",","perform","nonlinear","transformation",",","and","project","the","state","back","into","h","hidden","dimension","."]
code: def forward(self, hidden_states):
      # [s, b, 4hp]
      intermediate_parallel, bias_parallel = self.dense_h_to_4h(
          hidden_states
      )
  
      if self.fast_glu_activation:
          intermediate_parallel, intermediate_parallel_2 = torch.chunk(
              intermediate_parallel, 2, dim=-1
          )
          if bias_parallel is not None:
              bias_parallel, bias_parallel_2 = torch.chunk(
                  bias_parallel, 2, dim=-1
              )
      elif self.glu_activation_family and not self.fast_glu_activation:
          (
              intermediate_parallel_2,
              bias_parallel_2,
          ) = self.dense_h_to_4h_2(hidden_states)
  
      if self.bias_activation_fusion:
          if self.activation == "gelu":
              intermediate_parallel = fused_bias_gelu(
                  intermediate_parallel, bias_parallel
              )
          elif self.activation in ["geglu", "fast-geglu"]:
              intermediate_parallel = fused_bias_geglu(
                  intermediate_parallel,
                  bias_parallel,
                  intermediate_parallel_2,
                  bias_parallel_2,
              )
  
      elif (
          self.glu_activation_family and not self.bias_activation_fusion
      ):
          if bias_parallel is not None:
              intermediate_parallel = self.activation_func(
                  intermediate_parallel + bias_parallel
              ) * (intermediate_parallel_2 + bias_parallel_2)
          else:
              intermediate_parallel = (
                  self.activation_func(intermediate_parallel)
                  * intermediate_parallel_2
              )
  
      else:
          if bias_parallel is not None:
              intermediate_parallel = self.activation_func(
                  intermediate_parallel + bias_parallel
              )
          else:
              intermediate_parallel = self.activation_func(
                  intermediate_parallel
              )
  
      if self.dropout > 0:
          intermediate_parallel = F.dropout(
              intermediate_parallel,
              p=self.dropout,
              training=self.training,
          )
  
      infused_adapter = self.get_adapter_module(AdapterName.MLP_INFUSED)
      if infused_adapter:
          intermediate_parallel = infused_adapter(intermediate_parallel)
  
      # Normformer normalization
      if self.transformer_block_type == "normformer":
          intermediate_parallel = self.normalization(
              intermediate_parallel
          )
  
      # [s, b, h]
      output, output_bias = self.dense_4h_to_h(intermediate_parallel)
      return output, output_bias
  
imports: import torch
  import torch.nn.functional
  from nemo.collections.nlp.modules.common.megatron.adapters.parallel_adapters import AdapterName, MLPInfusedAdapterConfig
  from nemo.collections.nlp.modules.common.megatron.fused_bias_geglu import fused_bias_geglu
  from nemo.collections.nlp.modules.common.megatron.fused_bias_gelu import fused_bias_gelu
  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
  from nemo.collections.nlp.modules.common.megatron.module import MegatronModule
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults, ApproxGELUActivation, erf_gelu
  from nemo.collections.nlp.modules.common.megatron.utils import openai_gelu
  from nemo.collections.nlp.modules.common.megatron.utils import squared_relu
  from nemo.core import adapter_mixins
label_desc: Use image node_id 2 for calling the ParallelMLP obj's underlying member method code with example usage: obj.forward(hidden_states) and returns: output,  output_bias