MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeedExamples / BertLayer

Class BertLayer

bing_bert/nvidia/modeling.py:448–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446
447
448class BertLayer(nn.Module):
449 def __init__(self, config):
450 super(BertLayer, self).__init__()
451 self.attention = BertAttention(config)
452 self.intermediate = BertIntermediate(config)
453 self.output = BertOutput(config)
454
455 def forward(self, hidden_states, attention_mask):
456 attention_output = self.attention(hidden_states, attention_mask)
457 intermediate_output = self.intermediate(attention_output)
458 layer_output = self.output(intermediate_output, attention_output)
459 return layer_output
460
461class BertEncoder(nn.Module):
462 def __init__(self, config):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected