Method
get_init_h
(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
Tested by
no test coverage detected