Initialize the weights
(self, module)
| 21 | self.use_mean = False |
| 22 | |
| 23 | def _init_weights(self, module): |
| 24 | """ Initialize the weights """ |
| 25 | if isinstance(module, (nn.Linear, nn.Embedding, nn.Conv1d)): |
| 26 | # Slightly different from the TF version which uses truncated_normal for initialization |
| 27 | # cf https://github.com/pytorch/pytorch/pull/5617 |
| 28 | module.weight.data.normal_(mean=0.0, std=0.02) |
| 29 | |
| 30 | def query_emb(self, input_ids, attention_mask): |
| 31 | outputs1 = self.roberta(input_ids=input_ids, |
nothing calls this directly
no outgoing calls
no test coverage detected