I am not exactly sure how to achieve this. I tried adding the following line to the getitem method:
max_len=50
data = nn.ConstantPad1d((0, max_len - data.shape[0]), 0)(data)

where data represents one sequence (sample) of my data. However, one time step has multiple values, meaning that data looks something like this:
data = [[0,1,30,40,56], [5,4,8,13,15], [90,81,76,3,22], ...]

and I would like to pad it to a maximum sequence length, meaning to add as much timesteps as needed in order to receive the maximum length. What the code I added does, is padding each time step (so each array inside the sequence) to the desired length.