MCPcopy Create free account
hub / github.com/pytorch/tutorials / init_hidden

Method init_hidden

beginner_source/nlp/advanced_tutorial.py:181–183  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

179 self.hidden = self.init_hidden()
180
181 def init_hidden(self):
182 return (torch.randn(2, 1, self.hidden_dim // 2),
183 torch.randn(2, 1, self.hidden_dim // 2))
184
185 def _forward_alg(self, feats):
186 # Do the forward algorithm to compute the partition function

Callers 2

__init__Method · 0.95
_get_lstm_featuresMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected