@pranav it’s packed in an additional structure to hold the sequence lengths, but you might take out its .data attribute, compute a function on that, and rewrap it in a new torch.nn.utils.rnn.PackedSequence object.