Problems using torch.nn.functional.pad(...)

Hm ok… I actually used only 3 dimensions. Since it is outside the neural net and only one channel image anyway, batch and channel don’t play a role here. I really just want to change the shape of the image itself. That works great so far. But only with the default padding mode.

So for example if I want multiples of 128:

img.shape:
(279, 510, 510)

padded_img.shape:
(384, 512, 512)

So I am actually trying to index the depth, height and width and there is no batch and channels.