Here is a small dummy example:
from sklearn.model_selection import train_test_split

dataset_train = MyDataset(noise=...)
dataset_val = MyDataset()
dataset_test = MyDataset()

idx = np.arange(len(dataset_train))
train_idx, val_idx = train_test_split(idx, train_size=0.8)
val_idx, test_idx = train_test_split(val_idx, train_size=0.5)

dataset_train = Subset(dataset_train, train_idx)
dataset_val = Subset(dataset_val, val_idx)
dataset_test = Subset(dataset_test, test_idx)