You should define a Dataset class, and a then pass that to a Dataloader. This allows you to specify the batch_size.
A dataset class has the following template:
from torch.utils import data

class MyDataset(data.Dataset):
    def __init__(self):
          pass 

    def __getitem__(self, index):
          ## instructions to return a tensor for one image 
          ## and its label (if needed)
          pass

     def __len__(self):
          ## return the size of dataset
          pass
         



Doc for Dataset: https://pytorch.org/docs/stable/data.html?highlight=dataset#torch.utils.data.Dataset 11

Doc for DataLoader: https://pytorch.org/docs/stable/data.html?highlight=dataloader#torch.utils.data.DataLoader 10