Once you load the dataset, create a dataloader, and since the dataloader and then you can do something like:
a = iter(dataloader)
b = next(a)

where b is a minibatch.
An example:
    dataset = VQA_dataset(ROOT_DIR, train = False)


    loader = torch.utils.data.DataLoader(
                    dataset,
                    batch_size= 3,
                    shuffle=True,
                            )
    data = next(iter(loader))
    v, bb, spat, obs, a, q,  q_len, item = data


    torch.save(data, DUMMY_DATA)