def as_classification_dataset(
    dataset: ISupportedClassificationDataset[T_co],
    transform_groups: Optional[TransformGroups] = None,
) -> "TaskAwareClassificationDataset":
    """Converts a dataset with a `targets` field into an Avalanche ClassificationDataset."""
    from avalanche.benchmarks.utils.classification_dataset import ClassificationDataset

    if isinstance(dataset, ClassificationDataset):
        return dataset
    da = DataAttribute(dataset.targets, "targets")
    return ClassificationDataset(
        [dataset], transform_groups=transform_groups, data_attributes=[da]
    )
Converts a dataset with a `targets` field into an Avalanche ClassificationDataset.
avalanche/benchmarks/utils/utils.py