I think the best approach would be to write a custom Dataset taking the paths of the data tensors and targets, split the paths to a training and validation set, and create the training and validation Dataset using the paths subsets.