<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/load.py#L248-L435) |

Loader class for dataset collections.

    tfds.core.DatasetCollectionLoader(
        collection: dataset_collection_builder.DatasetCollection,
        requested_version: Optional[str] = None,
        loader_kwargs: (dict[str, Any] | None) = None
    )

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `collection` | the DatasetCollection to load. |
| `requested_version` | optional version of the dataset collection to load. If none given, the latest version will be loaded. |
| `loader_kwargs` | optional kwargs for the [`tfds.load`](https://www.tensorflow.org/datasets/api_docs/python/tfds/load) function. |
| `datasets` | initialized post-init, defines the datasets comprised in the requested dataset collection. |
| `collection_name` | the name of the DatasetCollection to load. |

<br />

## Methods

### `get_dataset_info`

[View source](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/load.py#L288-L297)

    get_dataset_info(
        dataset_name: str
    )

### `load_all_datasets`

[View source](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/load.py#L416-L435)

    load_all_datasets(
        split: Optional[Tree[splits_lib.SplitArg]] = None,
        loader_kwargs: (dict[str, Any] | None) = None
    ) -> Mapping[str, Mapping[str, tf.data.Dataset]]

Loads all datasets of a collection.

<br />

<br />

<br />

| Args ||
|---|---|
| `split` | which split(s) of the datasets to load. |
| `loader_kwargs` | `dict` (optional), keyword arguments to be passed to the [`tfds.load`](https://www.tensorflow.org/datasets/api_docs/python/tfds/load) function. Refer to [`tfds.load`](https://www.tensorflow.org/datasets/api_docs/python/tfds/load) documentation for a comperehensive overview of the different loading options. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| `dict` of `dataset_names` mapping to a `dict` of {`split_name`: tf.data.Dataset} for each desired datasets. ||

<br />

### `load_dataset`

[View source](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/load.py#L302-L383)

    load_dataset(
        dataset: str,
        split: Optional[Tree[splits_lib.SplitArg]] = None,
        loader_kwargs: (dict[str, Any] | None) = None
    ) -> Mapping[str, tf.data.Dataset]

Loads the named dataset from a dataset collection by calling [`tfds.load`](https://www.tensorflow.org/datasets/api_docs/python/tfds/load).

<br />

<br />

<br />

| Args ||
|---|---|
| `dataset` | `str`, the dataset name to load. |
| `split` | which split(s) of the dataset to load. If `None`, will return all splits available for the dataset. |
| `loader_kwargs` | `dict` (optional), keyword arguments to be passed to the [`tfds.load`](https://www.tensorflow.org/datasets/api_docs/python/tfds/load) function. Refer to [`tfds.load`](https://www.tensorflow.org/datasets/api_docs/python/tfds/load) documentation for a comperehensive overview of the different loading options. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A `dict` of {`str`: tf.data.Dataset} for the desided dataset. ||

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `KeyError` | if trying to load a dataset not included in the collection. |
| `RuntimeError` | if `load` return type is not a `dict` or a `list`. |

<br />

### `load_datasets`

[View source](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/load.py#L385-L414)

    load_datasets(
        datasets: Iterable[str],
        split: Optional[Tree[splits_lib.SplitArg]] = None,
        loader_kwargs: (dict[str, Any] | None) = None
    ) -> Mapping[str, Mapping[str, tf.data.Dataset]]

Loads a number of datasets from the dataset collection.

<br />

<br />

<br />

| Args ||
|---|---|
| `datasets` | dataset names to load. |
| `split` | which split(s) of the datasets to load. |
| `loader_kwargs` | keyword arguments to be passed to the [`tfds.load`](https://www.tensorflow.org/datasets/api_docs/python/tfds/load) function. Refer to [`tfds.load`](https://www.tensorflow.org/datasets/api_docs/python/tfds/load) documentation for a comperehensive overview of the different loading options. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| mapping between a dataset name and a mapping of split name to tf.data.Dataset for each requested dataset. ||

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | if no dataset(s) to load are given. |

<br />

### `print_datasets`

[View source](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/load.py#L285-L286)

    print_datasets() -> None

### `print_info`

[View source](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/load.py#L273-L283)

    print_info() -> None

Prints information about this dataset collection.

### `set_loader_kwargs`

[View source](https://github.com/tensorflow/datasets/blob/v4.9.10/tensorflow_datasets/core/load.py#L299-L300)

    set_loader_kwargs(
        loader_kwargs: dict[str, Any]
    )

### `__eq__`

    __eq__(
        other
    )

Return self==value.

<br />

<br />

<br />

| ## Class Variables ||
|---|---|
| loader_kwargs | `None` |
| requested_version | `None` |

<br />