Considering the output of a BLSTM in pytorch, what's the order of the elements?
Your answer is in the documentation of the code you linked in your comment:


  For the unpacked case, the directions can be separated using output.view(seq_len, batch, num_directions, hidden_size), with forward and backward being direction 0 and 1 respectively. Similarly, the directions can be separated in the packed case.


So you just need yo separate the directions as specified above and then take the element-wise maximum with torch.max.