code: def __init__(
      self,
      bert_model,
      output_dim,
      layer_pulled=-1,
      add_linear=None,
  ):
      super(BertEncoder, self).__init__()
      self.layer_pulled = layer_pulled
      bert_output_dim = (
          bert_model.embeddings.word_embeddings.weight.size(1)
      )
  
      self.bert_model = bert_model
      self.dropout = nn.Dropout(0.1)
      if add_linear:
          self.additional_linear = nn.Linear(
              bert_output_dim, output_dim
          )
      else:
          self.additional_linear = None
  
imports: from torch import nn
  import torch
label_desc: Use image node_id 1 to create a new BertEncoder object from inherited base classes: nn with example: obj = BertEncoder(bert_model, output_dim, layer_pulled, add_linear)