MCPcopy Create free account
hub / github.com/apple/ml-pointersect / get_init_h

Method get_init_h

cdslib/core/nn/modules/lstm.py:244–253  ·  view source on GitHub ↗
(self, batch_size=1, device=torch.device("cpu"))

Source from the content-addressed store, hash-verified

242 assert dim_output == dim_rnn
243
244 def get_init_h(self, batch_size=1, device=torch.device("cpu")):
245 return nn_utils.get_constant_rnn_hidden_states(
246 "lstm",
247 self.num_rnn_layers,
248 self.rnn_feature_dim,
249 batch_size,
250 bidirectional=self.bidirectional,
251 const=0.0,
252 device=device,
253 )
254
255 def forward(self, x, h0=None, valid_seq_lens=None):
256 """

Callers

nothing calls this directly

Calls 1

deviceMethod · 0.80

Tested by

no test coverage detected