Fix cell/hidden init issue, add copy states to test

Summary: As title. Wonder this had not been encountered before. Only affects cases where the states are copied over though.

Reviewed By: Yangqing

Differential Revision: D5777314

fbshipit-source-id: 8aef435c832e4ead5bb3d3e35bb065c734a2af5f
This commit is contained in:
Aapo Kyrola
2017-09-06 14:07:52 -07:00
committed by Facebook Github Bot
parent d4336edb05
commit ceb13bf3fb
2 changed files with 10 additions and 4 deletions

View File

@ -1396,7 +1396,7 @@ def cudnn_LSTM(model, input_blob, initial_states, dim_in, dim_out,
(hidden_input_blob, cell_input_blob) = initial_states
output, hidden_output, cell_output, rnn_scratch, dropout_states = \
model.net.Recurrent(
[input_blob, cell_input_blob, cell_input_blob, weights],
[input_blob, hidden_input_blob, cell_input_blob, weights],
["lstm_output", "lstm_hidden_output", "lstm_cell_output",
"lstm_rnn_scratch", "lstm_dropout_states"],
seed=random.randint(0, 100000), # TODO: dropout seed