Skip to content

Instantly share code, notes, and snippets.

@aliwaqas333
Created June 19, 2020 09:27
Show Gist options
  • Save aliwaqas333/3fb87523bd8f363fca7e1e72168f7868 to your computer and use it in GitHub Desktop.
Save aliwaqas333/3fb87523bd8f363fca7e1e72168f7868 to your computer and use it in GitHub Desktop.
To create a dataloader in PyTorch
from torch.utils.data.dataloader import DataLoader
from torchvision.utils import make_grid
batch_size = 32
train_dl = DataLoader(train_ds, batch_size*2, shuffle=True)
val_dl = DataLoader(val_ds, batch_size*2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment