If you want to get the top layer, you could return the first output of nn.LSTM:
lstm = nn.LSTM(3, 3, num_layers=2, batch_first=True, bidirectional=True)
x = Variable(torch.rand(1, 5, 3)) # batch=1, seq_len=5, dim=3
h, (h_t, c_t) = lstm(x)
print h.size() # (batch, seq_len, dim) = (1, 5, 6)
h_n = h[:,-1,:] # get the last time step, return (batch, dim) = (1, 6)