MCPcopy Index your code
hub / github.com/THUDM/GLM / __init__

Method __init__

model/modeling_bert.py:1192–1198  ·  view source on GitHub ↗
(self, config, num_labels=2)

Source from the content-addressed store, hash-verified

1190 """
1191
1192 def __init__(self, config, num_labels=2):
1193 super(BertForSequenceClassification, self).__init__(config)
1194 self.num_labels = num_labels
1195 self.bert = BertModel(config)
1196 self.dropout = nn.Dropout(config.hidden_dropout_prob)
1197 self.classifier = nn.Linear(config.hidden_size, num_labels)
1198 self.apply(self.init_bert_weights)
1199
1200 def forward(self, input_ids, token_type_ids=None, attention_mask=None, labels=None, checkpoint_activations=False):
1201 _, pooled_output = self.bert(input_ids, token_type_ids, attention_mask, output_all_encoded_layers=False,

Callers

nothing calls this directly

Calls 3

BertModelClass · 0.85
applyMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected