(module)
| 427 | def initialize_weights(self): |
| 428 | # Initialize transformer layers: |
| 429 | def _basic_init(module): |
| 430 | if isinstance(module, nn.Linear): |
| 431 | torch.nn.init.xavier_uniform_(module.weight) |
| 432 | if module.bias is not None: |
| 433 | nn.init.constant_(module.bias, 0) |
| 434 | self.apply(_basic_init) |
| 435 | |
| 436 | # Initialize (and freeze) pos_embed by sin-cos embedding: |
nothing calls this directly
no outgoing calls
no test coverage detected