(root=None,
                         split='train',
                         download=True,
                         **kwargs)
return dataset
Loads the CIFAR-10 dataset.

    Args:
        root (str): Path to where datasets are stored.
        split (str): The split of data to use.
        download (bool): If True, downloads the dataset.

    Returns:
        Dataset: Torch Dataset object.
Loads the CIFAR-10 dataset.
Loads the CIFAR - 10 dataset .
def load_cifar10_dataset(root=None,
                         split='train',
                         download=True,
                         **kwargs):
    """
    Loads the CIFAR-10 dataset.

    Args:
        root (str): Path to where datasets are stored.
        split (str): The split of data to use.
        download (bool): If True, downloads the dataset.

    Returns:
        Dataset: Torch Dataset object.
    """
    dataset_dir = root
    if dataset_dir and not os.path.exists(dataset_dir):
        os.makedirs(dataset_dir)

    # Build datasets
    if split == "train":
        dataset = data.dataset.CIFAR10(root=dataset_dir,
                                       train=True,
                                       download=download,
                                       **kwargs)
    elif split == "test":
        dataset = data.dataset.CIFAR10(root=dataset_dir,
                                       train=False,
                                       download=download,
                                       **kwargs)
    else:
        raise ValueError("split argument must one of ['train', 'val']")

    return dataset
def load_cifar10_dataset ( root = None , split = 'train' , download = True , * * kwargs ) : dataset_dir = root if dataset_dir and not os . path . exists ( dataset_dir ) : os . makedirs ( dataset_dir ) # Build datasets if split == "train" : dataset = data . dataset . CIFAR10 ( root = dataset_dir , train = True , download = download , * * kwargs ) elif split == "test" : dataset = data . dataset . CIFAR10 ( root = dataset_dir , train = False , download = download , * * kwargs ) else : raise ValueError ( "split argument must one of ['train', 'val']" ) return dataset