Irfft onesided=True does not merge the doubled centerline

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’

https://pytorch.org/docs/stable/torch.html#torch.irfft

Due to the conjugate symmetry, input do not need to contain the full complex frequency values. Roughly half of the values will be sufficient, as is the case when input is given by rfft() with rfft(signal, onesided=True) . In such case, set the onesided argument of this method to True . Moreover, the original signal shape information can sometimes be lost, optionally set signal_sizes to be the size of the original signal (without the batch dimensions if in batched mode) to recover it with correct shape.

Thank you, I had missed the ‘signal_sizes’ argument. much appreciated