MCPcopy Create free account
hub / github.com/tensorflow/datasets / add_data_dir

Function add_data_dir

tensorflow_datasets/core/utils/file_utils.py:87–102  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

85
86
87def 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
105def clear_registered_data_dirs() -> None:

Callers

nothing calls this directly

Calls 1

addMethod · 0.45

Tested by

no test coverage detected