@@ -439,8 +439,8 @@ class PreTrainedBertModel(nn.Module):
|
|||||||
# cf https://github.com/pytorch/pytorch/pull/5617
|
# cf https://github.com/pytorch/pytorch/pull/5617
|
||||||
module.weight.data.normal_(mean=0.0, std=self.config.initializer_range)
|
module.weight.data.normal_(mean=0.0, std=self.config.initializer_range)
|
||||||
elif isinstance(module, BertLayerNorm):
|
elif isinstance(module, BertLayerNorm):
|
||||||
module.bias.data.normal_(mean=0.0, std=self.config.initializer_range)
|
module.bias.data.zero_()
|
||||||
module.weight.data.normal_(mean=0.0, std=self.config.initializer_range)
|
module.weight.data.fill_(1.0)
|
||||||
if isinstance(module, nn.Linear) and module.bias is not None:
|
if isinstance(module, nn.Linear) and module.bias is not None:
|
||||||
module.bias.data.zero_()
|
module.bias.data.zero_()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user