Bidirectional lstm batched padded sequence

I’m passing a pack_padded_sequence to the bidirectional lstm and i want to get the foward and reverse lstm outputs, concatenate both of them and pass it to the fully connected layer.Also when i use pad_packed_sequence on the ‘h_t’ output of the lstm it gives the original padded sequence which has pads in it.

How should i proceed after retrieving the ‘h_t’ from the lstm?

I’m not sure to completely understand your use case, but I usually refer to @vdw’s post to get a quick recap how to slice which output.

Thanks for replying, i figured it out.

Can you please mention how?