Currently, it appears that the forward method only returns the output state but not the recurrent state, and the only way to get the recurrent state is to use the step method for each time-step, which presumably is less efficient.
So I was wondering if there is a drop-in replacement for nn.LSTM, which returns both the output state and the last recurrent state?
Firstly, thanks for releasing the code!
Currently, it appears that the
forward
method only returns the output state but not the recurrent state, and the only way to get the recurrent state is to use thestep
method for each time-step, which presumably is less efficient.So I was wondering if there is a drop-in replacement for nn.LSTM, which returns both the output state and the last recurrent state?