MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / reset_parameters

Method reset_parameters

imperative/python/megengine/module/rnn.py:50–53  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

48 # if bias is False self.bias will remain zero
49
50 def reset_parameters(self) -> None:
51 stdv = 1.0 / math.sqrt(self.hidden_size)
52 for weight in self.parameters():
53 init.uniform_(weight, -stdv, stdv)
54
55 @abstractmethod
56 def forward(self, input: Tensor, hx: Optional[Tensor] = None) -> Tensor:

Callers 1

__init__Method · 0.95

Calls 2

parametersMethod · 0.80
sqrtMethod · 0.45

Tested by

no test coverage detected