def loader_info(
            loader: Union[DataLoader, Iterable[DataLoader]],
        ) -> Union[dataset_info, Iterable[dataset_info]]:
            """Helper function to compute dataset information."""
            return apply_to_collection(loader, DataLoader, retrieve_dataset_info)
Helper function to compute dataset information.
src/lightning/pytorch/core/datamodule.py