def METHOD_NAME(self, images):
    max_size = tuple(max(s) for s in zip(*[img.shape for img in images]))
    image_sizes = [im.shape[-2:] for im in images]
    images = [
        F.METHOD_NAME(
            im,
            [0, max_size[-1] - size[1], 0, max_size[-2] - size[0]],
            value=self.pad_value,
        )
        for size, im in zip(image_sizes, images)
    ]
    return torch.stack(images), torch.tensor(image_sizes)