def forward(self, x):
    (output, hidden) = self.layer1.forward(x, self.layer1.init_hidden())
    hidden0 = hidden[0].transpose(0, 1).reshape(batch_size, 1, (- 1)).transpose(0, 1)
    hidden1 = hidden[1].transpose(0, 1).reshape(batch_size, 1, (- 1)).transpose(0, 1)
    decoder_hidden = (hidden0, hidden1)
    encoder_outputs = output
    last_output = self.layer2.forward(decoder_hidden, output, input)
    return last_output
def forward(self, x):
    (output, hidden) = self.layer1.forward(x, self.layer1.init_hidden())
    hidden0 = hidden[0].transpose(0, 1).reshape(batch_size, 1, (- 1)).transpose(0, 1)
    hidden1 = hidden[1].transpose(0, 1).reshape(batch_size, 1, (- 1)).transpose(0, 1)
    decoder_hidden = (hidden0, hidden1)
    encoder_outputs = output
    last_output = self.layer2.forward(decoder_hidden, output, input)
    return last_output