Skip to content

Commit

Permalink
deuglify mnist example
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 688922829
  • Loading branch information
Qwlouse authored and The kauldron Authors committed Oct 23, 2024
1 parent ebb9144 commit c815431
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions examples/mnist_autoencoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ def get_config():


def _make_ds(training: bool):
Tfds = kd.data.py.Tfds
return Tfds(
return kd.data.py.Tfds(
name="mnist",
split="train" if training else "test",
shuffle=True if training else False,
Expand Down
2 changes: 1 addition & 1 deletion kauldron/data/py/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def ds_for_current_process(self, rng: random.PRNGKey) -> grain.MapDataset:

def _get_num_workers(num_workers: int) -> int:
"""Set the number of workers."""
if epy.is_notebook(): # in colab worker_count has to be 0
if epy.is_notebook() or epy.is_test(): # in colab worker_count has to be 0
# TODO(klausg): autodetect if Kernel supports multiprocessing
# Could check
# from multiprocessing import spawn
Expand Down

0 comments on commit c815431

Please sign in to comment.