Repository: Project-MONAI/MONAI
File: monai/data/dataset.py (Python)

Code before:
        col_names: Sequence[str] | None = None,
        col_types: dict[str, dict[str, Any] | None] | None = None,
        col_groups: dict[str, Sequence[str]] | None = None,
        transform: Callable | None = None,
        kwargs_read_csv: dict | None = None,
        **kwargs,
    ):
        srcs = (src,) if not isinstance(src, (tuple, list)) else src
        dfs: list = []
        for i in srcs:
            if isinstance(i, str):
                dfs.append(pd.read_csv(i, **kwargs_read_csv) if kwargs_read_csv else pd.read_csv(i))
            elif isinstance(i, pd.DataFrame):
                dfs.append(i)
            else:
                raise ValueError("`src` must be file path or pandas `DataFrame`.")

        data = convert_tables_to_dicts(
            dfs=dfs, row_indices=row_indices, col_names=col_names, col_types=col_types, col_groups=col_groups, **kwargs
        )
        super().__init__(data=data, transform=transform)


class GDSDataset(PersistentDataset):
    """
    Re-implementation of the PersistentDataset. GDSDataset enables a direct direct memory access(DMA) data path between
    GPU memory and storage, thus avoiding a bounce buffer through the CPU. This direct path can increase system
    bandwidth while decreasing latency and utilization load on the CPU and GPU.

    A tutorial is available: https://github.com/Project-MONAI/tutorials/blob/main/modules/GDS_dataset.ipynb.
    """

    def __init__(
        self,
        data: Sequence,
        transform: Sequence[Callable] | Callable,
        cache_dir: Path | str | None,
        device: int,
        hash_func: Callable[..., bytes] = pickle_hashing,
        hash_transform: Callable[..., bytes] | None = None,
        reset_ops_id: bool = True,
        **kwargs: Any,
    ) -> None:
        """
        Args:
            data: input data file paths to load and transform to generate dataset for model.
                `GDSDataset` expects input data to be a list of serializable
                and hashes them as cache keys using `hash_func`.
            transform: transforms to execute operations on input data.
            cache_dir: If specified, this is the location for gpu direct storage
                of pre-computed transformed data tensors. The cache_dir is computed once, and

Review comment (suggestion):
```suggestion
    An extension of the PersistentDataset using direct memory access(DMA) data path between
```

Code after:
        col_names: Sequence[str] | None = None,
        col_types: dict[str, dict[str, Any] | None] | None = None,
        col_groups: dict[str, Sequence[str]] | None = None,
        transform: Callable | None = None,
        kwargs_read_csv: dict | None = None,
        **kwargs,
    ):
        srcs = (src,) if not isinstance(src, (tuple, list)) else src
        dfs: list = []
        for i in srcs:
            if isinstance(i, str):
                dfs.append(pd.read_csv(i, **kwargs_read_csv) if kwargs_read_csv else pd.read_csv(i))
            elif isinstance(i, pd.DataFrame):
                dfs.append(i)
            else:
                raise ValueError("`src` must be file path or pandas `DataFrame`.")

        data = convert_tables_to_dicts(
            dfs=dfs, row_indices=row_indices, col_names=col_names, col_types=col_types, col_groups=col_groups, **kwargs
        )
        super().__init__(data=data, transform=transform)


class GDSDataset(PersistentDataset):
    """
    An extension of the PersistentDataset using direct memory access(DMA) data path between
    GPU memory and storage, thus avoiding a bounce buffer through the CPU. This direct path can increase system
    bandwidth while decreasing latency and utilization load on the CPU and GPU.

    A tutorial is available: https://github.com/Project-MONAI/tutorials/blob/main/modules/GDS_dataset.ipynb.
    """

    def __init__(
        self,
        data: Sequence,
        transform: Sequence[Callable] | Callable,
        cache_dir: Path | str | None,
        device: int,
        hash_func: Callable[..., bytes] = pickle_hashing,
        hash_transform: Callable[..., bytes] | None = None,
        reset_ops_id: bool = True,
        **kwargs: Any,
    ) -> None:
        """
        Args:
            data: input data file paths to load and transform to generate dataset for model.
                `GDSDataset` expects input data to be a list of serializable
                and hashes them as cache keys using `hash_func`.
            transform: transforms to execute operations on input data.
            cache_dir: If specified, this is the location for gpu direct storage
                of pre-computed transformed data tensors. The cache_dir is computed once, and