I don’t think you have to change your dataset.
It looks like you would need to remove the fop loops over input_length and target_length.
This would also mean to change the view call after the nn.Embedding layers in your models, since then your batch size and sequence length won’t be 1 anymore. (embedded = self.embedding(input).view(1, 1, -1))