Time series classification with variable series length

Hi there!
I’m solving a problem with RNNs where the time series have varying lengths, to be more concrete the examples in the training set are mostly of the same size (which I solve with paddding) but when it comes to the validation dataset the examples are 3-5 times longer (with respect to time).
The idea was to chunk the validation set examples into portions that have similar size to the examples in the train set. Is there an efficient way to implement this with collate_fn, or with the Dataset module?

Thank you!