diff --git a/bing_bert/nvidia/modelingpreln.py b/bing_bert/nvidia/modelingpreln.py index 099b894f3..d22d21063 100755 --- a/bing_bert/nvidia/modelingpreln.py +++ b/bing_bert/nvidia/modelingpreln.py @@ -393,9 +393,6 @@ def __init__(self, config): self.token_type_embeddings = nn.Embedding(config.type_vocab_size, config.hidden_size) - # self.LayerNorm is not snake-cased to stick with TensorFlow model variable name and be able to load - # any TensorFlow checkpoint file - self.LayerNorm = BertLayerNorm(config.hidden_size, eps=1e-12) self.dropout = nn.Dropout(config.hidden_dropout_prob) def forward(self, input_ids, token_type_ids=None): @@ -412,7 +409,6 @@ def forward(self, input_ids, token_type_ids=None): token_type_embeddings = self.token_type_embeddings(token_type_ids) embeddings = words_embeddings + position_embeddings + token_type_embeddings - embeddings = self.LayerNorm(embeddings) embeddings = self.dropout(embeddings) return embeddings