code: def createValidationDataSampler(dataset, ratio):
    
    indices = np.random.permutation(len(dataset))
    training_count = int(len(indices) * ratio)
    train = torch.utils.data.SubsetRandomSampler(indices=indices[:training_count])
    validate = torch.utils.data.SubsetRandomSampler(indices=indices[training_count:])
    return (train, validate)
docs: Create `torch.utils.data.Sampler`s used to split the dataset into 2 ramdom
    sampled subsets. The first should used for training and the second for
    validation.
  
    :param dataset: A valid torch.utils.data.Dataset (i.e. torchvision.datasets.MNIST)
    :param ratio: The percentage of the dataset to be used for training. The
                  remaining (1-ratio)% will be used for validation
    :return: tuple with 2 torch.utils.data.Sampler. (train, validate)