the error is showing on the train function inside that encoder
encoder_output, encoder_hidden = encoder(
        input_tensor, encoder_hidden)

this line.Now returning new error

RuntimeError: input must have 3 dimensions, got 2