Thanks again. By the way, if I desing bi-directional encoder and stacked RNN, the hidden state of the encoder ($h_n$) must be [# layers * # dir, Batch, Hidden] and it doesn’t match to $H$'s dimension [Seq_len, Batch, # dir * hid] for feed to initial decoder’s hidden state. How can I solve it? Just employ a FC layer?