thanks for the reply.
kc, kh, kw = 256, 256, 256# kernel size
dc, dh, dw = 256, 256, 256  # stride
        x = F.pad(x, (imgs.size(2) % kw // 2, imgs.size(2) % kw // 2,
                      imgs.size(1) % kh // 2, imgs.size(1) % kh // 2,
                      imgs.size(0) % kc // 2, imgs.size(0) % kc // 2))

        patches = x.unfold(1, kw, dw).unfold(2, kh, dh).unfold(3, kc, dc)

        patches = patches.contiguous().view(-1, kc, kh, kw)
        print(patches.shape)

img size = torch.Size([1, 3, 3055, 2935])
if I run the above code I am getting this error
RuntimeError: shape ‘[-1, 1, 256, 265]’ is invalid for input of size 45416448