Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nondeterministic_order to dataset_info.py #5725

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions tensorflow_datasets/core/dataset_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ def __init__(
features: feature_lib.FeatureConnector | None = None,
supervised_keys: SupervisedKeysType | None = None,
disable_shuffling: bool = False,
nondeterministic_order: bool = False,
homepage: str | None = None,
citation: str | None = None,
metadata: Metadata | None = None,
Expand Down Expand Up @@ -229,11 +228,7 @@ def __init__(

Note that selecting features in nested `tfds.features.FeaturesDict`
objects is not supported.
disable_shuffling: `bool`, specifies whether to shuffle the examples.
nondeterministic_order: `bool`, if True and the dataset uses beam, it will
use `NoShuffleBeamWriter` which does not assure deterministic
shuffling when writing' examples to disk. This might result in quicker
dataset preparation.
disable_shuffling: `bool`, specify whether to shuffle the examples.
homepage: `str`, optional, the homepage for this dataset.
citation: `str`, optional, the citation to use for this dataset.
metadata: `tfds.core.Metadata`, additonal object which will be
Expand Down Expand Up @@ -273,7 +268,6 @@ def __init__(
version=str(self._identity.version),
release_notes=self._identity.release_notes,
disable_shuffling=disable_shuffling,
nondeterministic_order=nondeterministic_order,
config_name=self._identity.config_name,
config_description=self._identity.config_description,
config_tags=self._identity.config_tags,
Expand Down Expand Up @@ -348,7 +342,6 @@ def from_proto(
features=features,
supervised_keys=supervised_keys,
disable_shuffling=proto.disable_shuffling,
nondeterministic_order=proto.nondeterministic_order,
citation=proto.citation,
license=proto.redistribution_info.license,
split_dict=splits_lib.SplitDict.from_proto(
Expand Down Expand Up @@ -407,13 +400,6 @@ def release_notes(self) -> dict[str, str] | None:
def disable_shuffling(self) -> bool:
return self.as_proto.disable_shuffling

@property
def nondeterministic_order(self) -> bool:
return self._info_proto.nondeterministic_order

def set_nondeterministic_order(self, nondeterministic_order: bool) -> None:
self._info_proto.nondeterministic_order = nondeterministic_order

@property
def homepage(self) -> str:
urls = self.as_proto.location.urls
Expand Down Expand Up @@ -937,7 +923,6 @@ def __repr__(self):
("features", _indent(repr(self.features))),
("supervised_keys", self.supervised_keys),
("disable_shuffling", self.disable_shuffling),
("nondeterministic_order", self.nondeterministic_order),
("splits", splits),
("citation", _indent(f'"""{self.citation}"""')),
# Proto add a \n that we strip.
Expand All @@ -955,7 +940,6 @@ def __getstate__(self):
"features": self.features,
"supervised_keys": self.supervised_keys,
"disable_shuffling": self.disable_shuffling,
"nondeterministic_order": self.nondeterministic_order,
"homepage": self.homepage,
"citation": self.citation,
"metadata": self.metadata,
Expand All @@ -972,7 +956,6 @@ def __setstate__(self, state):
features=state["features"],
supervised_keys=state["supervised_keys"],
disable_shuffling=state["disable_shuffling"],
nondeterministic_order=state["nondeterministic_order"],
homepage=state["homepage"],
citation=state["citation"],
metadata=state["metadata"],
Expand Down
1 change: 0 additions & 1 deletion tensorflow_datasets/core/dataset_info_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,6 @@ def test_get_split_info_from_proto_unavailable_format(self):
}),
supervised_keys=('image', 'label'),
disable_shuffling=False,
nondeterministic_order=False,
splits={
'test': <SplitInfo num_examples=20, num_shards=1>,
'train': <SplitInfo num_examples=20, num_shards=1>,
Expand Down
Loading