Hi
The code does not work with bidirectional encoder, and line 23 when it is written the self.bidirectional else self.nb_layers * 2, the self.nb_layers is not defined, and also the hidden size of encoder does not match the hidden size of the decoder in case of bidirectional encoder.
thanks.