Yes, you generate images + labels inside your dataset, and the DataLoader will batch the individual samples and allocate GPU memory if Pinned=True (at least, I think it needs to be True for the allocation to be performed automatically).