code: def forward(self, token_ids, segment_ids, attention_mask):
      output_bert, output_pooler = self.bert_model(
          token_ids, segment_ids, attention_mask
      )
      # get embedding of [CLS] token
      if self.additional_linear is not None:
          embeddings = output_pooler
      else:
          embeddings = output_bert[:, 0, :]
  
      # in case of dimensionality reduction
      if self.additional_linear is not None:
          result = self.additional_linear(self.dropout(embeddings))
      else:
          result = embeddings
  
      return result
  
imports: from torch import nn
label_desc: Use image node_id 2 for calling the BertEncoder obj's underlying member method code with example usage: obj.forward(token_ids, segment_ids, attention_mask) and returns: result