Skip to content

Instantly share code, notes, and snippets.

@GitHubEmploy
Created December 30, 2021 20:57
Show Gist options
  • Save GitHubEmploy/a507dbfe0451c5ee8bcbdfa58d37a8e2 to your computer and use it in GitHub Desktop.
Save GitHubEmploy/a507dbfe0451c5ee8bcbdfa58d37a8e2 to your computer and use it in GitHub Desktop.
# MNIST dataset
train_dataset = torchvision.datasets.MNIST(root='data',
train=True,
transform=transforms.ToTensor(),
download=True)
test_dataset = torchvision.datasets.MNIST(root='data',
train=False,
transform=transforms.ToTensor())
# Data loader
train_loader = torch.utils.data.DataLoader(dataset=train_dataset,
batch_size=batch_size,
shuffle=True)
test_loader = torch.utils.data.DataLoader(dataset=test_dataset,
batch_size=batch_size,
shuffle=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment