Skip to content

Commit

Permalink
[tfds] Fix tfds.as_numpy which now returns a reusable iterable.
Browse files Browse the repository at this point in the history
`next(ds)` -> `next(iter(ds))`

PiperOrigin-RevId: 324977229
Change-Id: I17506d76a6b99eb8b64f43a88e94d57f12e23598
Conchylicultor authored and copybara-github committed Aug 5, 2020
1 parent 329ef3c commit 7203ae8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/mnist.py
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ def load_dataset(
if is_training:
ds = ds.shuffle(10 * batch_size, seed=0)
ds = ds.batch(batch_size)
return tfds.as_numpy(ds)
return iter(tfds.as_numpy(ds))


def main(_):

0 comments on commit 7203ae8

Please sign in to comment.