code: def forward(self, hidden_states, pool=True):
      # We "pool" the model by simply taking the hidden state corresponding
      # to the first token.
      first_token_tensor = (
          hidden_states[:, 0] if pool else hidden_states
      )
      pooled_output = self.dense(first_token_tensor)
      pooled_output = self.activation(pooled_output)
      return pooled_output
  
imports: import logging
  import re
  from collections import OrderedDict
  from collections.abc import Sequence
  from functools import partial
  from typing import Any, Mapping
  import torch
  import torch.nn
  import torch.nn.functional
  from einops import rearrange
  from transformers import BertConfig, PretrainedConfig
  from transformers.models.bert.modeling_bert import BaseModelOutputWithPoolingAndCrossAttentions, BertForPreTrainingOutput
  from flash_attn.bert_padding import index_first_axis, index_first_axis_residual, pad_input, unpad_input
  from flash_attn.modules.block import Block
  from flash_attn.modules.embedding import BertEmbeddings
  from flash_attn.modules.mha import MHA
  from flash_attn.modules.mlp import FusedMLP, Mlp
  from flash_attn.utils.pretrained import state_dict_from_pretrained
label_desc: Use image node_id 2 for calling the BertPooler obj's underlying member method code with example usage: obj.forward(hidden_states, pool) and returns: pooled_output