Hi every one. I have a seq2seq problem. My data include input data and corresonding labels. Lengths of sequences in input data are different and lengths of sequences in labels are also different.

**Ex:**

*- Data 1: input data length: 1, label length: 5*

*- Data 2: input data length: 8, label length: 3*

*- Data 3: input data length: 2, label length: 7*

*- Data 4: input data length: 5, label length: 5*

*- …*

As a result, I want to use padding and packing when training. However, when I use torch.nn.utils.rnn.pack_padded_sequence Link, it always sort the data in decreasing order of length.

**For example:**

```
x_packed = pack_padded_sequence(xx_pad, x_lens, batch_first=True, enforce_sorted=False)
y_packed = pack_padded_sequence(yy_pad, y_lens, batch_first=True, enforce_sorted=False)
```

After packing, both input data (x) and labels (y) are sorted. It causes the correspondence between x, y pairs to be lost.

Can you help me please ! Thank you so much !