Skip to content

Commit 1c843c2

Browse files
sync changes.
2 parents 748ef92 + 041b65e commit 1c843c2

File tree

242 files changed

+7347
-1324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

242 files changed

+7347
-1324
lines changed

docs/api_docs/python/_toc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ toc:
3232
path: /datasets/api_docs/python/tfds/core/DatasetBuilder
3333
- title: DatasetInfo
3434
path: /datasets/api_docs/python/tfds/core/DatasetInfo
35+
- title: Experiment
36+
path: /datasets/api_docs/python/tfds/core/Experiment
3537
- title: GeneratorBasedBuilder
3638
path: /datasets/api_docs/python/tfds/core/GeneratorBasedBuilder
3739
- title: get_tfds_path

docs/api_docs/python/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* <a href="./tfds/core/BuilderConfig.md"><code>tfds.core.BuilderConfig</code></a>
1111
* <a href="./tfds/core/DatasetBuilder.md"><code>tfds.core.DatasetBuilder</code></a>
1212
* <a href="./tfds/core/DatasetInfo.md"><code>tfds.core.DatasetInfo</code></a>
13+
* <a href="./tfds/core/Experiment.md"><code>tfds.core.Experiment</code></a>
1314
* <a href="./tfds/core/GeneratorBasedBuilder.md"><code>tfds.core.GeneratorBasedBuilder</code></a>
1415
* <a href="./tfds/core/Metadata.md"><code>tfds.core.Metadata</code></a>
1516
* <a href="./tfds/core/MetadataDict.md"><code>tfds.core.MetadataDict</code></a>

docs/api_docs/python/tfds/_api_cache.json

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
"tfds.core.BeamBasedBuilder.builder_config": "tfds.core.DatasetBuilder.builder_config",
1111
"tfds.core.BeamBasedBuilder.data_dir": "tfds.core.DatasetBuilder.data_dir",
1212
"tfds.core.BeamBasedBuilder.info": "tfds.core.DatasetBuilder.info",
13+
"tfds.core.BeamBasedBuilder.version": "tfds.core.DatasetBuilder.version",
1314
"tfds.core.GeneratorBasedBuilder.BUILDER_CONFIGS": "tfds.core.DatasetBuilder.BUILDER_CONFIGS",
1415
"tfds.core.GeneratorBasedBuilder.SUPPORTED_VERSIONS": "tfds.core.DatasetBuilder.SUPPORTED_VERSIONS",
1516
"tfds.core.GeneratorBasedBuilder.builder_config": "tfds.core.DatasetBuilder.builder_config",
1617
"tfds.core.GeneratorBasedBuilder.data_dir": "tfds.core.DatasetBuilder.data_dir",
1718
"tfds.core.GeneratorBasedBuilder.info": "tfds.core.DatasetBuilder.info",
19+
"tfds.core.GeneratorBasedBuilder.version": "tfds.core.DatasetBuilder.version",
1820
"tfds.core.MetadataDict.__contains__": "tfds.core.Metadata.__contains__",
1921
"tfds.core.MetadataDict.__eq__": "tfds.core.Metadata.__eq__",
2022
"tfds.core.MetadataDict.__ge__": "tfds.core.Metadata.__ge__",
@@ -67,25 +69,9 @@
6769
"tfds.core.SplitDict.viewitems": "tfds.core.Metadata.viewitems",
6870
"tfds.core.SplitDict.viewkeys": "tfds.core.Metadata.viewkeys",
6971
"tfds.core.SplitDict.viewvalues": "tfds.core.Metadata.viewvalues",
70-
"tfds.core.Version.__init__": "tfds.core.SplitBase.__init__",
7172
"tfds.features.Audio.dtype": "tfds.features.FeatureConnector.dtype",
7273
"tfds.features.Audio.shape": "tfds.features.FeatureConnector.shape",
73-
"tfds.features.BBox.__add__": "tfds.core.Version.__add__",
74-
"tfds.features.BBox.__contains__": "tfds.core.Version.__contains__",
75-
"tfds.features.BBox.__eq__": "tfds.core.Version.__eq__",
76-
"tfds.features.BBox.__ge__": "tfds.core.Version.__ge__",
77-
"tfds.features.BBox.__getitem__": "tfds.core.Version.__getitem__",
78-
"tfds.features.BBox.__gt__": "tfds.core.Version.__gt__",
7974
"tfds.features.BBox.__init__": "tfds.core.SplitBase.__init__",
80-
"tfds.features.BBox.__iter__": "tfds.core.Version.__iter__",
81-
"tfds.features.BBox.__le__": "tfds.core.Version.__le__",
82-
"tfds.features.BBox.__len__": "tfds.core.Version.__len__",
83-
"tfds.features.BBox.__lt__": "tfds.core.Version.__lt__",
84-
"tfds.features.BBox.__mul__": "tfds.core.Version.__mul__",
85-
"tfds.features.BBox.__ne__": "tfds.core.Version.__ne__",
86-
"tfds.features.BBox.__rmul__": "tfds.core.Version.__rmul__",
87-
"tfds.features.BBox.count": "tfds.core.Version.count",
88-
"tfds.features.BBox.index": "tfds.core.Version.index",
8975
"tfds.features.BBoxFeature.dtype": "tfds.features.FeatureConnector.dtype",
9076
"tfds.features.BBoxFeature.shape": "tfds.features.FeatureConnector.shape",
9177
"tfds.features.ClassLabel.dtype": "tfds.features.FeatureConnector.dtype",
@@ -110,11 +96,13 @@
11096
"tfds.testing.DummyDatasetSharedGenerator.builder_config": "tfds.core.DatasetBuilder.builder_config",
11197
"tfds.testing.DummyDatasetSharedGenerator.data_dir": "tfds.core.DatasetBuilder.data_dir",
11298
"tfds.testing.DummyDatasetSharedGenerator.info": "tfds.core.DatasetBuilder.info",
99+
"tfds.testing.DummyDatasetSharedGenerator.version": "tfds.core.DatasetBuilder.version",
113100
"tfds.testing.DummyMnist.BUILDER_CONFIGS": "tfds.core.DatasetBuilder.BUILDER_CONFIGS",
114101
"tfds.testing.DummyMnist.SUPPORTED_VERSIONS": "tfds.core.DatasetBuilder.SUPPORTED_VERSIONS",
115102
"tfds.testing.DummyMnist.builder_config": "tfds.core.DatasetBuilder.builder_config",
116103
"tfds.testing.DummyMnist.data_dir": "tfds.core.DatasetBuilder.data_dir",
117104
"tfds.testing.DummyMnist.info": "tfds.core.DatasetBuilder.info",
105+
"tfds.testing.DummyMnist.version": "tfds.core.DatasetBuilder.version",
118106
"tfds.testing.FeatureExpectationsTestCase.failureException": "tfds.testing.DatasetBuilderTestCase.failureException",
119107
"tfds.testing.FeatureExpectationsTestCase.failureException.__getitem__": "tfds.testing.DatasetBuilderTestCase.failureException.__getitem__",
120108
"tfds.testing.FeatureExpectationsTestCase.failureException.__init__": "tfds.testing.DatasetBuilderTestCase.failureException.__init__",
@@ -151,8 +139,6 @@
151139
"tfds.core": false,
152140
"tfds.core.BeamBasedBuilder": false,
153141
"tfds.core.BeamBasedBuilder.BUILDER_CONFIGS": true,
154-
"tfds.core.BeamBasedBuilder.GOOGLE_DISABLED": true,
155-
"tfds.core.BeamBasedBuilder.IN_DEVELOPMENT": true,
156142
"tfds.core.BeamBasedBuilder.SUPPORTED_VERSIONS": true,
157143
"tfds.core.BeamBasedBuilder.VERSION": true,
158144
"tfds.core.BeamBasedBuilder.__init__": true,
@@ -163,6 +149,7 @@
163149
"tfds.core.BeamBasedBuilder.download_and_prepare": true,
164150
"tfds.core.BeamBasedBuilder.info": true,
165151
"tfds.core.BeamBasedBuilder.name": true,
152+
"tfds.core.BeamBasedBuilder.version": true,
166153
"tfds.core.BuilderConfig": false,
167154
"tfds.core.BuilderConfig.__init__": true,
168155
"tfds.core.BuilderConfig.description": true,
@@ -171,8 +158,6 @@
171158
"tfds.core.BuilderConfig.version": true,
172159
"tfds.core.DatasetBuilder": false,
173160
"tfds.core.DatasetBuilder.BUILDER_CONFIGS": true,
174-
"tfds.core.DatasetBuilder.GOOGLE_DISABLED": true,
175-
"tfds.core.DatasetBuilder.IN_DEVELOPMENT": true,
176161
"tfds.core.DatasetBuilder.SUPPORTED_VERSIONS": true,
177162
"tfds.core.DatasetBuilder.VERSION": true,
178163
"tfds.core.DatasetBuilder.__init__": true,
@@ -183,6 +168,7 @@
183168
"tfds.core.DatasetBuilder.download_and_prepare": true,
184169
"tfds.core.DatasetBuilder.info": true,
185170
"tfds.core.DatasetBuilder.name": true,
171+
"tfds.core.DatasetBuilder.version": true,
186172
"tfds.core.DatasetInfo": false,
187173
"tfds.core.DatasetInfo.__init__": true,
188174
"tfds.core.DatasetInfo.as_json": true,
@@ -205,10 +191,11 @@
205191
"tfds.core.DatasetInfo.urls": true,
206192
"tfds.core.DatasetInfo.version": true,
207193
"tfds.core.DatasetInfo.write_to_directory": true,
194+
"tfds.core.Experiment": false,
195+
"tfds.core.Experiment.DUMMY": true,
196+
"tfds.core.Experiment.S3": true,
208197
"tfds.core.GeneratorBasedBuilder": false,
209198
"tfds.core.GeneratorBasedBuilder.BUILDER_CONFIGS": true,
210-
"tfds.core.GeneratorBasedBuilder.GOOGLE_DISABLED": true,
211-
"tfds.core.GeneratorBasedBuilder.IN_DEVELOPMENT": true,
212199
"tfds.core.GeneratorBasedBuilder.SUPPORTED_VERSIONS": true,
213200
"tfds.core.GeneratorBasedBuilder.VERSION": true,
214201
"tfds.core.GeneratorBasedBuilder.__init__": true,
@@ -219,6 +206,7 @@
219206
"tfds.core.GeneratorBasedBuilder.download_and_prepare": true,
220207
"tfds.core.GeneratorBasedBuilder.info": true,
221208
"tfds.core.GeneratorBasedBuilder.name": true,
209+
"tfds.core.GeneratorBasedBuilder.version": true,
222210
"tfds.core.Metadata": false,
223211
"tfds.core.Metadata.__contains__": true,
224212
"tfds.core.Metadata.__eq__": true,
@@ -287,12 +275,14 @@
287275
"tfds.core.NamedSplit.__add__": true,
288276
"tfds.core.NamedSplit.__eq__": true,
289277
"tfds.core.NamedSplit.__init__": true,
278+
"tfds.core.NamedSplit.__ne__": true,
290279
"tfds.core.NamedSplit.get_read_instruction": true,
291280
"tfds.core.NamedSplit.subsplit": true,
292281
"tfds.core.SplitBase": false,
293282
"tfds.core.SplitBase.__add__": true,
294283
"tfds.core.SplitBase.__eq__": true,
295284
"tfds.core.SplitBase.__init__": true,
285+
"tfds.core.SplitBase.__ne__": true,
296286
"tfds.core.SplitBase.get_read_instruction": true,
297287
"tfds.core.SplitBase.subsplit": true,
298288
"tfds.core.SplitDict": false,
@@ -337,27 +327,16 @@
337327
"tfds.core.SplitInfo.get_proto": true,
338328
"tfds.core.SplitInfo.num_examples": true,
339329
"tfds.core.Version": false,
340-
"tfds.core.Version.LATEST": true,
341-
"tfds.core.Version.__add__": true,
342-
"tfds.core.Version.__contains__": true,
343330
"tfds.core.Version.__eq__": true,
344331
"tfds.core.Version.__ge__": true,
345-
"tfds.core.Version.__getitem__": true,
346332
"tfds.core.Version.__gt__": true,
347333
"tfds.core.Version.__init__": true,
348-
"tfds.core.Version.__iter__": true,
349334
"tfds.core.Version.__le__": true,
350-
"tfds.core.Version.__len__": true,
351335
"tfds.core.Version.__lt__": true,
352-
"tfds.core.Version.__mul__": true,
353336
"tfds.core.Version.__ne__": true,
354-
"tfds.core.Version.__rmul__": true,
355-
"tfds.core.Version.count": true,
356-
"tfds.core.Version.index": true,
357-
"tfds.core.Version.major": true,
337+
"tfds.core.Version.implements": true,
358338
"tfds.core.Version.match": true,
359-
"tfds.core.Version.minor": true,
360-
"tfds.core.Version.patch": true,
339+
"tfds.core.Version.tuple": true,
361340
"tfds.core.get_tfds_path": false,
362341
"tfds.core.lazy_imports": false,
363342
"tfds.disable_progress_bar": false,
@@ -462,6 +441,7 @@
462441
"tfds.features.FeatureConnector.save_metadata": true,
463442
"tfds.features.FeatureConnector.shape": true,
464443
"tfds.features.FeaturesDict": false,
444+
"tfds.features.FeaturesDict.__contains__": true,
465445
"tfds.features.FeaturesDict.__getitem__": true,
466446
"tfds.features.FeaturesDict.__init__": true,
467447
"tfds.features.FeaturesDict.__iter__": true,
@@ -600,8 +580,6 @@
600580
"tfds.file_adapter.TFRecordExampleAdapter.__init__": true,
601581
"tfds.file_adapter.TFRecordExampleAdapter.dataset_from_filename": true,
602582
"tfds.file_adapter.TFRecordExampleAdapter.filetype_suffix": true,
603-
"tfds.file_adapter.TFRecordExampleAdapter.parse_example": true,
604-
"tfds.file_adapter.TFRecordExampleAdapter.serialize_example": true,
605583
"tfds.file_adapter.TFRecordExampleAdapter.write_from_generator": true,
606584
"tfds.file_adapter.TFRecordExampleAdapter.write_from_pcollection": true,
607585
"tfds.is_dataset_on_gcs": false,
@@ -615,10 +593,10 @@
615593
"tfds.testing.DatasetBuilderTestCase.DATASET_CLASS": true,
616594
"tfds.testing.DatasetBuilderTestCase.DL_EXTRACT_RESULT": true,
617595
"tfds.testing.DatasetBuilderTestCase.EXAMPLE_DIR": true,
618-
"tfds.testing.DatasetBuilderTestCase.INTERNAL_DATASET": true,
619596
"tfds.testing.DatasetBuilderTestCase.MOCK_MONARCH": true,
620597
"tfds.testing.DatasetBuilderTestCase.MOCK_OUT_FORBIDDEN_OS_FUNCTIONS": true,
621598
"tfds.testing.DatasetBuilderTestCase.OVERLAPPING_SPLITS": true,
599+
"tfds.testing.DatasetBuilderTestCase.VERSION": true,
622600
"tfds.testing.DatasetBuilderTestCase.__call__": true,
623601
"tfds.testing.DatasetBuilderTestCase.__eq__": true,
624602
"tfds.testing.DatasetBuilderTestCase.__init__": true,
@@ -760,8 +738,6 @@
760738
"tfds.testing.DatasetBuilderTestCase.test_session": true,
761739
"tfds.testing.DummyDatasetSharedGenerator": false,
762740
"tfds.testing.DummyDatasetSharedGenerator.BUILDER_CONFIGS": true,
763-
"tfds.testing.DummyDatasetSharedGenerator.GOOGLE_DISABLED": true,
764-
"tfds.testing.DummyDatasetSharedGenerator.IN_DEVELOPMENT": true,
765741
"tfds.testing.DummyDatasetSharedGenerator.SUPPORTED_VERSIONS": true,
766742
"tfds.testing.DummyDatasetSharedGenerator.VERSION": true,
767743
"tfds.testing.DummyDatasetSharedGenerator.__init__": true,
@@ -772,10 +748,9 @@
772748
"tfds.testing.DummyDatasetSharedGenerator.download_and_prepare": true,
773749
"tfds.testing.DummyDatasetSharedGenerator.info": true,
774750
"tfds.testing.DummyDatasetSharedGenerator.name": true,
751+
"tfds.testing.DummyDatasetSharedGenerator.version": true,
775752
"tfds.testing.DummyMnist": false,
776753
"tfds.testing.DummyMnist.BUILDER_CONFIGS": true,
777-
"tfds.testing.DummyMnist.GOOGLE_DISABLED": true,
778-
"tfds.testing.DummyMnist.IN_DEVELOPMENT": true,
779754
"tfds.testing.DummyMnist.SUPPORTED_VERSIONS": true,
780755
"tfds.testing.DummyMnist.VERSION": true,
781756
"tfds.testing.DummyMnist.__init__": true,
@@ -786,6 +761,7 @@
786761
"tfds.testing.DummyMnist.download_and_prepare": true,
787762
"tfds.testing.DummyMnist.info": true,
788763
"tfds.testing.DummyMnist.name": true,
764+
"tfds.testing.DummyMnist.version": true,
789765
"tfds.testing.FeatureExpectationItem": false,
790766
"tfds.testing.FeatureExpectationItem.__init__": true,
791767
"tfds.testing.FeatureExpectationsTestCase": false,
@@ -1212,7 +1188,6 @@
12121188
"tfds.units.MiB": true,
12131189
"tfds.units.PiB": true,
12141190
"tfds.units.TiB": true,
1215-
"tfds.units.absolute_import": true,
12161191
"tfds.units.division": true,
12171192
"tfds.units.print_function": true,
12181193
"tfds.units.size_str": false

docs/api_docs/python/tfds/core.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Defined in [`core/__init__.py`](https://github.com/tensorflow/datasets/tree/mast
2222

2323
[`class DatasetInfo`](../tfds/core/DatasetInfo.md): Information about a dataset.
2424

25+
[`class Experiment`](../tfds/core/Experiment.md): Experiments which can be
26+
enabled/disabled on a per version basis.
27+
2528
[`class GeneratorBasedBuilder`](../tfds/core/GeneratorBasedBuilder.md): Base class for datasets with data generation based on dict generators.
2629

2730
[`class Metadata`](../tfds/core/Metadata.md): Abstract base class for

docs/api_docs/python/tfds/core/BeamBasedBuilder.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
<meta itemprop="property" content="builder_config"/>
55
<meta itemprop="property" content="data_dir"/>
66
<meta itemprop="property" content="info"/>
7+
<meta itemprop="property" content="version"/>
78
<meta itemprop="property" content="__init__"/>
89
<meta itemprop="property" content="as_dataset"/>
910
<meta itemprop="property" content="download_and_prepare"/>
1011
<meta itemprop="property" content="BUILDER_CONFIGS"/>
11-
<meta itemprop="property" content="GOOGLE_DISABLED"/>
12-
<meta itemprop="property" content="IN_DEVELOPMENT"/>
1312
<meta itemprop="property" content="SUPPORTED_VERSIONS"/>
1413
<meta itemprop="property" content="VERSION"/>
1514
<meta itemprop="property" content="builder_configs"/>
@@ -52,7 +51,9 @@ Callers must pass arguments as keyword arguments.
5251
subdirectories and versions.
5352
* <b>`version`</b>: `str`. Optional version at which to load the dataset. An
5453
error is raised if specified version cannot be satisfied. Eg: '1.2.3',
55-
'1.2.*'.
54+
'1.2.*'. The special value "experimental_latest" will use the highest
55+
version, even if not default. This is not recommended unless you know what
56+
you are doing, as the version could be broken.
5657

5758
## Properties
5859

@@ -66,16 +67,19 @@ Callers must pass arguments as keyword arguments.
6667

6768
<a href="../../tfds/core/DatasetInfo.md"><code>tfds.core.DatasetInfo</code></a> for this builder.
6869

70+
<h3 id="version"><code>version</code></h3>
71+
6972
## Methods
7073

7174
<h3 id="as_dataset"><code>as_dataset</code></h3>
7275

7376
```python
7477
as_dataset(
7578
split=None,
76-
batch_size=1,
79+
batch_size=None,
7780
shuffle_files=None,
78-
as_supervised=False
81+
as_supervised=False,
82+
in_memory=None
7983
)
8084
```
8185

@@ -90,16 +94,20 @@ Callers must pass arguments as keyword arguments.
9094
which subset(s) of the data to read. If None (default), returns all splits
9195
in a dict `<key: tfds.Split, value: tf.data.Dataset>`.
9296
* <b>`batch_size`</b>: `int`, batch size. Note that variable-length features
93-
will be 0-padded if `batch_size > 1`. Users that want more custom behavior
94-
should use `batch_size=1` and use the `tf.data` API to construct a custom
95-
pipeline. If `batch_size == -1`, will return feature dictionaries of the
96-
whole dataset with `tf.Tensor`s instead of a `tf.data.Dataset`.
97+
will be 0-padded if `batch_size` is set. Users that want more custom
98+
behavior should use `batch_size=None` and use the `tf.data` API to construct
99+
a custom pipeline. If `batch_size == -1`, will return feature dictionaries
100+
of the whole dataset with `tf.Tensor`s instead of a `tf.data.Dataset`.
97101
* <b>`shuffle_files`</b>: `bool`, whether to shuffle the input files. Defaults
98102
to `True` if `split == tfds.Split.TRAIN` and `False` otherwise.
99103
* <b>`as_supervised`</b>: `bool`, if `True`, the returned `tf.data.Dataset`
100104
will have a 2-tuple structure `(input, label)` according to
101105
`builder.info.supervised_keys`. If `False`, the default, the returned
102106
`tf.data.Dataset` will have a dictionary with all the features.
107+
* <b>`in_memory`</b>: `bool`, if `True`, loads the dataset in memory which
108+
increases iteration speeds. Note that if `True` and the dataset has unknown
109+
dimensions, the features will be padded to the maximum size across the
110+
dataset.
103111

104112
#### Returns:
105113

@@ -137,8 +145,6 @@ Downloads and prepares dataset for reading.
137145
## Class Members
138146

139147
* `BUILDER_CONFIGS` <a id="BUILDER_CONFIGS"></a>
140-
* `GOOGLE_DISABLED = False` <a id="GOOGLE_DISABLED"></a>
141-
* `IN_DEVELOPMENT = False` <a id="IN_DEVELOPMENT"></a>
142148
* `SUPPORTED_VERSIONS` <a id="SUPPORTED_VERSIONS"></a>
143149
* `VERSION = None` <a id="VERSION"></a>
144150
* `builder_configs` <a id="builder_configs"></a>

0 commit comments

Comments
 (0)