Skip to content

fix: allow num_workers=0 by using explicit None check#34

Open
smksyj wants to merge 1 commit into
GitYCC:masterfrom
smksyj:patch-1
Open

fix: allow num_workers=0 by using explicit None check#34
smksyj wants to merge 1 commit into
GitYCC:masterfrom
smksyj:patch-1

Conversation

@smksyj

@smksyj smksyj commented Mar 12, 2026

Copy link
Copy Markdown

num_workers=0 is silently ignored because the truthiness check (if num_workers) treats 0 as falsy in python, falling back to self.config.num_workers (default 2).

This means passing num_workers=0 to disable DataLoader multiprocessing has no effect.

Replacing the check with is not None fixes this, so that 0 is correctly respected while None still falls back to the config default.

`num_workers=0` is silently ignored because the truthiness check (`if num_workers`) treats `0` as falsy, falling back to `self.config.num_workers` (default `2`).

This means passing `num_workers=0` to disable DataLoader multiprocessing has no effect.

Replacing the check with `is not None` fixes this, so that `0` is correctly respected while `None` still falls back to the config default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant