Wrap the Dataset in a DataLoader, where you can specify the batch_size besides other useful features like shuffling and the usage of multiple workers. Have a look at the docs for more information and maybe the Data loading tutorial 8 for some more information on the data loading pipeline.