From 7c28e05e0dd282f722a7111e4bb1e73693e3459d Mon Sep 17 00:00:00 2001 From: BENKHADDA Mohamed Yassine <46766351+mohamed-yassine-benkhadda@users.noreply.github.com> Date: Tue, 2 Aug 2022 15:33:16 +0100 Subject: [PATCH] Update ffc.py There is no module in torch rfft or irfft. rfft and irfft are in torch.fft --- model_zoo/ffc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model_zoo/ffc.py b/model_zoo/ffc.py index e7eed5fb..66fafad1 100644 --- a/model_zoo/ffc.py +++ b/model_zoo/ffc.py @@ -51,7 +51,7 @@ def forward(self, x): r_size = x.size() # (batch, c, h, w/2+1, 2) - ffted = torch.rfft(x, signal_ndim=2, normalized=True) + ffted = torch.fft.rfft(x, signal_ndim=2, normalized=True) # (batch, c, 2, h, w/2+1) ffted = ffted.permute(0, 1, 4, 2, 3).contiguous() ffted = ffted.view((batch, -1,) + ffted.size()[3:]) @@ -62,7 +62,7 @@ def forward(self, x): ffted = ffted.view((batch, -1, 2,) + ffted.size()[2:]).permute( 0, 1, 3, 4, 2).contiguous() # (batch,c, t, h, w/2+1, 2) - output = torch.irfft(ffted, signal_ndim=2, + output = torch.fft.irfft(ffted, signal_ndim=2, signal_sizes=r_size[2:], normalized=True) return output