Prefix DataLoaderIter with underscore to discourage subclassing#5619
Merged
apaszke merged 1 commit intopytorch:masterfrom Mar 8, 2018
Merged
Prefix DataLoaderIter with underscore to discourage subclassing#5619apaszke merged 1 commit intopytorch:masterfrom
apaszke merged 1 commit intopytorch:masterfrom
Conversation
apaszke
approved these changes
Mar 8, 2018
mdraw
added a commit
to ELEKTRONN/elektronn3
that referenced
this pull request
Mar 21, 2018
DataLoaderIter has been renamed to _DataLoaderIter "to discourage subclassing" (pytorch/pytorch#5619). The custom DelayededDataLoader mechanism is still useful for two reasons: - Prevents crashes when KeyboardInterrupts are triggered "at the wrong time". Replacing everything with vanilla PyTorch DataLoaders leads to a complete crash when <C-c>-ing during background process initialization (RuntimeError: DataLoader worker (pid 15559) exited unexpectedly with exit code 1). But: When initialization is finished (so, after ~2 seconds), the vanilla PyTorch DataLoader does recover from interrupts: When continuing, new background processes are started automatically and continue making batches. - Reduced visual noise in the terminal (large tracebacks are suppressed) I am not sure if those reasons are good enough for keeping it though...
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Discourage subclassing
DataLoaderIterso that errors like #5430 hopefully won't happen as often.@apaszke