Initialize a Linear or Convolutional layer.
(layer)
| 22 | |
| 23 | |
| 24 | def init_embedding(layer): |
| 25 | """Initialize a Linear or Convolutional layer. """ |
| 26 | nn.init.uniform_(layer.weight, -1., 1.) |
| 27 | |
| 28 | if hasattr(layer, 'bias'): |
| 29 | if layer.bias is not None: |
| 30 | layer.bias.data.fill_(0.) |
| 31 | |
| 32 | |
| 33 | def init_gru(rnn): |
nothing calls this directly
no outgoing calls
no test coverage detected