Assume your image being in tensor x you could do x.unsqueeze(0) or you could use the pytorch data package 265 and it’s Datasets/Dataloader which automatically create minibatches.
For vision there is something similar in the torchvision package.