When calling lstm_output, hn = self.lstm(input, (h0, c0)), you get :


lstm_output from the last layer, for all the time steps.
(shape:[seq_len, batch, num_directions*hidden_size])


hn from all the layers, for the last time step
(  tuple of two tensors, hidden and cell, both of shape:[num_layers*num_directions, batch, hidden_size])


(It’s all in the docs)
So in your code, forward_v1 will give an output computed from the last lstm layer, for all the time steps (and I think the .view() line may cause problems, it does not correspond to the shape of hn[0]), whereas forward_v2 will give an output computed also from the last lstm layer (since you called lstm_out[-1], but only from the last time step.