def retrieve_dataset_info(loader: DataLoader) -> dataset_info:
            """Helper function to compute dataset information."""
            dataset = loader.dataset
            size: str = str(len(dataset)) if isinstance(dataset, Sized) else "NA"

            return dataset_info(True, size)
Helper function to compute dataset information.
src/lightning/pytorch/core/datamodule.py