MCPcopy Create free account
hub / github.com/THUDM/GLM / __init__

Method __init__

model/modeling_bert.py:438–448  ·  view source on GitHub ↗
(self, config)

Source from the content-addressed store, hash-verified

436
437class BertAttention(nn.Module):
438 def __init__(self, config):
439 super(BertAttention, self).__init__()
440 self.self = BertSelfAttention(config)
441 # self.self = mpu.BertParallelSelfAttention(
442 # hidden_size=config.hidden_size,
443 # num_attention_heads=config.num_attention_heads,
444 # dropout_prob=config.attention_probs_dropout_prob,
445 # output_parallel=True,
446 # init_method=normal_init_method(mean=0.0,
447 # std=config.initializer_range))
448 self.output = BertSelfOutput(config)
449
450 def forward(self, input_tensor, attention_mask):
451 self_output = self.self(input_tensor, attention_mask)

Callers

nothing calls this directly

Calls 3

BertSelfAttentionClass · 0.85
BertSelfOutputClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected