def partition_datasets(train_cfg, partitions):
    all_datasets = {}
    for split_name in ['train', 'val']:
        all_datasets[split_name] = utils.partition_dataset(name=train_cfg.dataset.name, root=train_cfg.dataset.root, split=split_name, partitions=partitions, equalize_partitions=train_cfg.dataset.equalize_partitions)
    return all_datasets
def partition_datasets(train_cfg, partitions):
    all_datasets = {}
    for split_name in ['train', 'val']:
        all_datasets[split_name] = utils.partition_dataset(name=train_cfg.dataset.name, root=train_cfg.dataset.root, split=split_name, partitions=partitions, equalize_partitions=train_cfg.dataset.equalize_partitions)
    return all_datasets