def _unpack_bidirectional_input_h(h):
    """
    Unpack the bidirectional hidden states into states of the 2 separate directions.
    """
    h_t, c_t = h
    h_front, h_back = h_t[::2], h_t[1::2]
    c_front, c_back = c_t[::2], c_t[1::2]
    h_front = (h_front, c_front)
    h_back = (h_back, c_back)
    return h_front, h_back