z = torch.zeros([1,3,224,224])
fft = torch.rfft(z, 2, onesided=True)
out = torch.irfft(fft, 2, onesided=True)
print(z.shape, out.shape)
#torch.Size([1, 3, 224, 224]) torch.Size([1, 3, 224, 225])

I understand that rfft duplicates centerline, irfft should remove it, i suppose. Im using onesided=False instead, but unless im mistaken theres a few code lines that must be missing
torch.version ‘1.1.0’