Skip to content

Commit

Permalink
Update examples/get_started/torch-loader.py
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry authored Dec 12, 2024
1 parent f3a384e commit b92a9dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/get_started/torch-loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def forward(self, x):
train_loader = DataLoader(
ds.to_pytorch(transform=transform),
batch_size=25,
num_workers=4,
num_workers=max(4, os.cpu_count() or 2),
persistent_workers=True,
multiprocessing_context=multiprocessing.get_context("spawn"),
)
Expand Down

0 comments on commit b92a9dd

Please sign in to comment.