MCPcopy Create free account
hub / github.com/pytorch/examples / _init_weights

Method _init_weights

language_translation/src/model.py:61–64  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

59 self._init_weights()
60
61 def _init_weights(self):
62 for p in self.parameters():
63 if p.dim() > 1:
64 nn.init.xavier_uniform_(p)
65
66 def forward(self, src, trg, src_mask, tgt_mask, src_padding_mask, tgt_padding_mask, memory_key_padding_mask):
67

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected