Skip to content

Commit 9cbc5da

Browse files
carmoccalexierule
authored andcommitted
Fix docs filterwarnings snippet (#10671)
1 parent f620dc8 commit 9cbc5da

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

docs/source/guides/speed.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,7 @@ For debugging purposes or for dataloaders that load very small datasets, it is d
151151
152152
import warnings
153153
154-
warnings.filterwarnings(
155-
"ignore", ".*does not have many workers. Consider increasing the value of the `num_workers` argument*"
156-
)
154+
warnings.filterwarnings("ignore", ".*Consider increasing the value of the `num_workers` argument*")
157155
158156
Spawn
159157
"""""

pytorch_lightning/trainer/data_loading.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def _worker_check(self, dataloader: DataLoader, name: str) -> None:
107107
)
108108

109109
elif dataloader.num_workers <= 2 < num_cpus and not using_spawn:
110+
# if changed, update the `filterwarnings` snippet in 'speed.html#num-workers'
110111
rank_zero_warn(
111112
f"The dataloader, {name}, does not have many workers which may be a bottleneck."
112113
" Consider increasing the value of the `num_workers` argument`"

0 commit comments

Comments
 (0)