def prepare_data(dataset: str, transform: Optional[Callable]=None, data_dir: Optional[Union[(str, Path)]]=None, train_dir: Optional[Union[(str, Path)]]=None, val_dir: Optional[Union[(str, Path)]]=None, batch_size: int=64, num_workers: int=4) -> Tuple[(DataLoader, DataLoader)]:
    'Prepares transformations, creates dataset objects and wraps them in dataloaders.\n\n    Args:\n        dataset (str): dataset name.\n        data_dir (Optional[Union[str, Path]], optional): path where to download/locate the dataset.\n            Defaults to None.\n        train_dir (Optional[Union[str, Path]], optional): subpath where the\n            training data is located. Defaults to None.\n        val_dir (Optional[Union[str, Path]], optional): subpath where the\n            validation data is located. Defaults to None.\n        batch_size (int, optional): batch size. Defaults to 64.\n        num_workers (int, optional): number of parallel workers. Defaults to 4.\n\n    Returns:\n        Tuple[DataLoader, DataLoader]: prepared training and validation dataloader;.\n    '
    if (transform is None):
        (T_train, T_val) = prepare_transforms(dataset)
    else:
        T_train = transform
        T_val = transform
    (train_dataset, val_dataset) = prepare_datasets(dataset, T_train, T_val, data_dir=data_dir, train_dir=train_dir, val_dir=val_dir)
    (train_loader, val_loader) = prepare_dataloaders(train_dataset, val_dataset, batch_size=batch_size, num_workers=num_workers)
    return (train_loader, val_loader)
Prepares transformations, creates dataset objects and wraps them in dataloaders.

Args:
    dataset (str): dataset name.
    data_dir (Optional[Union[str, Path]], optional): path where to download/locate the dataset.
        Defaults to None.
    train_dir (Optional[Union[str, Path]], optional): subpath where the
        training data is located. Defaults to None.
    val_dir (Optional[Union[str, Path]], optional): subpath where the
        validation data is located. Defaults to None.
    batch_size (int, optional): batch size. Defaults to 64.
    num_workers (int, optional): number of parallel workers. Defaults to 4.

Returns:
    Tuple[DataLoader, DataLoader]: prepared training and validation dataloader;.
def prepare_data(dataset: str, transform: Optional[Callable]=None, data_dir: Optional[Union[(str, Path)]]=None, train_dir: Optional[Union[(str, Path)]]=None, val_dir: Optional[Union[(str, Path)]]=None, batch_size: int=64, num_workers: int=4) -> Tuple[(DataLoader, DataLoader)]:
    'Prepares transformations, creates dataset objects and wraps them in dataloaders.\n\n    Args:\n        dataset (str): dataset name.\n        data_dir (Optional[Union[str, Path]], optional): path where to download/locate the dataset.\n            Defaults to None.\n        train_dir (Optional[Union[str, Path]], optional): subpath where the\n            training data is located. Defaults to None.\n        val_dir (Optional[Union[str, Path]], optional): subpath where the\n            validation data is located. Defaults to None.\n        batch_size (int, optional): batch size. Defaults to 64.\n        num_workers (int, optional): number of parallel workers. Defaults to 4.\n\n    Returns:\n        Tuple[DataLoader, DataLoader]: prepared training and validation dataloader;.\n    '
    if (transform is None):
        (T_train, T_val) = prepare_transforms(dataset)
    else:
        T_train = transform
        T_val = transform
    (train_dataset, val_dataset) = prepare_datasets(dataset, T_train, T_val, data_dir=data_dir, train_dir=train_dir, val_dir=val_dir)
    (train_loader, val_loader) = prepare_dataloaders(train_dataset, val_dataset, batch_size=batch_size, num_workers=num_workers)
    return (train_loader, val_loader)