docstr: Args:
      token: (B, L), index of tokens
      att_mask: (B, L), attention mask (1 for contents and 0 for padding)
  Return:
      (B, H), representations for sentences
docstr_tok: ["Args",":","token",":","(","B",",","L",")",",","index","of","tokens","att_mask",":","(","B",",","L",")",",","attention","mask","(","1","for","contents","and","0","for","padding",")","Return",":","(","B",",","H",")",",","representations","for","sentences"]
code: def forward(self, token, att_mask, pos1, pos2):
      """
      Args:
          token: (B, L), index of tokens
          att_mask: (B, L), attention mask (1 for contents and 0 for padding)
      Return:
          (B, H), representations for sentences
      """
      _, x = self.bert(
          token, attention_mask=att_mask, return_dict=False
      )
      # return_dict=fault is set to adapt to the new version of transformers
      return x
  
file_path: OpenNRE/opennre/encoder/bert_encoder.py
imports: import logging
  import torch
  import torch.nn
  from transformers import BertModel, BertTokenizer
  from .base_encoder import BaseEncoder
label_desc: Use image node_id 2 for calling the BERTEncoder obj's underlying member method code with example usage: obj.forward(token, att_mask, pos1, pos2) and returns: x