Registers a new default `data_dir` to search for datasets. When a `tfds.core.DatasetBuilder` is created with `data_dir=None`, TFDS will look in all registered `data_dir` (including the default one) to load existing datasets. * An error is raised if a dataset can be loaded from more than 1
(data_dir: PathLike)
| 85 | |
| 86 | |
| 87 | def add_data_dir(data_dir: PathLike) -> None: |
| 88 | """Registers a new default `data_dir` to search for datasets. |
| 89 | |
| 90 | When a `tfds.core.DatasetBuilder` is created with `data_dir=None`, TFDS |
| 91 | will look in all registered `data_dir` (including the default one) to |
| 92 | load existing datasets. |
| 93 | |
| 94 | * An error is raised if a dataset can be loaded from more than 1 registered |
| 95 | data_dir. |
| 96 | * This only affects reading datasets. Generation always uses the |
| 97 | `data_dir` kwargs when specified or `tfds.core.constant.DATA_DIR` otherwise. |
| 98 | |
| 99 | Args: |
| 100 | data_dir: New data_dir to register. |
| 101 | """ |
| 102 | _REGISTERED_DATA_DIRS.add(Path(data_dir)) |
| 103 | |
| 104 | |
| 105 | def clear_registered_data_dirs() -> None: |