class_docstr: Pooler layer.
  
  Pool hidden states of a specific token (for example start of the
  sequence) and add a linear transformation followed by a tanh.
  
  Arguments:
      hidden_size: hidden size
      init_method: weight initialization method for the linear layer.
          bias is set to zero.
code: def forward(self, hidden_states, sequence_index=0):
      # hidden_states: [s, b, h] prompt_embeddings
      # sequence_index: index of the token to pool.
  
      # gather data along sequence dimensions
      # same pooler is run on all tensor parallel nodes
      if self.sequence_parallel:
          hidden_states = tensor_parallel.mappings.gather_from_sequence_parallel_region(
              hidden_states
          )
  
      pooled = hidden_states[sequence_index, :, :]
      pooled = self.dense(pooled)
      pooled = torch.tanh(pooled)
      return pooled
  
imports: from ast import Mod
  import torch
  from nemo.collections.nlp.modules.common.megatron.adapters.parallel_adapters import AdapterName, PromptEncoderAdapterConfig
  from nemo.collections.nlp.modules.common.megatron.layer_type import LayerType
  from nemo.collections.nlp.modules.common.megatron.module import MegatronModule
  from nemo.collections.nlp.modules.common.megatron.position_embedding import ALiBiRelativePositionEmbedding, KERPLERelativePositionEmbedding, RotaryEmbedding, SandwichRelativePositionEmbedding
  from nemo.collections.nlp.modules.common.megatron.transformer import ParallelTransformer
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults, get_linear_layer, init_method_normal, scaled_init_method_normal
  from nemo.collections.nlp.parts import utils_funcs
  from nemo.core import adapter_mixins
label_desc: Use image node_id 2 for calling the Pooler obj's underlying member method code with example usage: obj.forward(hidden_states, sequence_index) and returns: pooled