示例#1
0
 def __init__(self, config, project_dim: int = 0):
     BertModel.__init__(self, config)
     assert config.hidden_size > 0, "Encoder hidden_size can't be zero"
     self.encode_proj = nn.Linear(config.hidden_size,
                                  project_dim) if project_dim != 0 else None
     self.init_weights()
示例#2
0
 def __init__(self, config):
     BertModel.__init__(self, config)
     assert config.hidden_size > 0, 'Encoder hidden_size can\'t be zero'
     self.init_weights()