


T = torch.fft.rfft2(t)



Without specifying the output length to "irfft2()", the output will
   not round-trip properly because the input is odd-length in the last
   dimension:



torch.fft.irfft2(T).size()
   torch.Size([10, 8])



So, it is recommended to always pass the signal shape "s".



roundtrip = torch.fft.irfft2(T, t.size())
roundtrip.size()
   torch.Size([10, 9])
torch.testing.assert_close(roundtrip, t, check_stride=False)


