Skip to content

Commit

Permalink
Update tfds.load() callers to specify shuffle_files=True when nec…
Browse files Browse the repository at this point in the history
…essary.

PiperOrigin-RevId: 264401453
  • Loading branch information
pierrot0 authored and copybara-github committed Aug 20, 2019
1 parent 8f35157 commit 98a2052
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tensorflow_datasets/core/dataset_builder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_determinism(self):
name="dummy_dataset_shared_generator",
data_dir=tmp_dir,
split=splits_lib.Split.TRAIN,
as_dataset_kwargs=dict(shuffle_files=False))
shuffle_files=False)
ds_values = list(dataset_utils.as_numpy(ds))

# Ensure determinism. If this test fail, this mean that numpy random
Expand All @@ -152,7 +152,7 @@ def test_multi_split(self):
name="dummy_dataset_shared_generator",
data_dir=tmp_dir,
split=["train", "test"],
as_dataset_kwargs=dict(shuffle_files=False))
shuffle_files=False)

data = list(dataset_utils.as_numpy(ds_train))
self.assertEqual(20, len(data))
Expand Down
3 changes: 2 additions & 1 deletion tensorflow_datasets/video/moving_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ def animate(sequence):
tf.enable_eager_execution()
mnist_ds = tfds.load("mnist", split=tfds.Split.TRAIN, as_supervised=True)
mnist_ds = tfds.load("mnist", split=tfds.Split.TRAIN, as_supervised=True,
shuffle_files=True)
mnist_ds = mnist_ds.repeat().shuffle(1024)
def map_fn(image, label):
Expand Down

0 comments on commit 98a2052

Please sign in to comment.