Loading...
Create a DataLoader to batch a dataset.
DataLoader wraps a Dataset and provides automatic batching, shuffling, and parallel loading — the standard way to feed data into a training loop.
Write a function create_dataloader(dataset, batch_size) that returns a DataLoader for the given dataset with the specified batch size (no shuffling).
Return a DataLoader object.
dataset (6 samples), batch_size=2, shuffle=False
DataLoader with 3 batches
DataLoader automatically handles batching - 6 samples with batch_size=2 gives 3 batches