The DataLoader calls into Dataset.__getitem__ to get the current sample and creates a batch out of these samples. It can also use different samplers, a custom collate_fn, multiple workers etc.
The image tensor shape if defined in your Dataset, i.e. how you are loading and preprocessing the images. If you want to resize the tensors to a specific shape, you could use transformation such as  torchvision.transforms.Resize inside Dataset.__getitem__.