Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/hunkim/PyTorchZeroToAll
/ init_hidden
Method
init_hidden
seq2seq_models.py:59–61 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
57
return
output, hidden
58
59
def
init_hidden(self):
60
# (num_layers * num_directions, batch, hidden_size)
61
return
cuda_variable(torch.zeros(self.n_layers, 1, self.hidden_size))
62
63
64
class
DecoderRNN(nn.Module):
Callers
1
test
Function · 0.95
Calls
1
cuda_variable
Function · 0.85
Tested by
no test coverage detected