Sine:

My input is variable-sized, such as torch.Size([4, 2, 100]), torch.Size([4, 2, 100]), torch.Size([5, 2, 100]), torch.Size([6, 2, 100]), torch.Size([6, 2, 100])


Can you elaborate a bit more on the usecase?



 Sine:

when I pad all the inputs into the same size (such as Size([10, 2, 100]))?


Yes, you can always pad the input to a standard size to get it working with dataloader.
Even otherwise, you can write a custom collate function to handle different-sized data instances.
I am not sure of your usecase though