Get forward and backward output seperately from bidirectional RNN

Hi all,

I am confused by the output format of bidirectional RNN. Is the forward and backward output concatenated on the last dimesion? Can I assume the first hidden_size of the last dimension of the output tensor is from the forward part?

Thanks!

3 Likes

I have the same question… Is there anybody know the answer?

Yes the outputs of the two directions are concatenated on the last dimension, so to get all forward outputs out[:, :, :hidden_size] and backwards out[:, :, hidden_size:]

9 Likes