RalphMao / PatchNet

19 stars 10 forks source link

fourier_feature.py #1

Open abbasaqeel opened 2 years ago

abbasaqeel commented 2 years ago

hi @RalphMao .. fourier_feature is not wotk with pytorch 1.7.0 because the function torch.rfft is removed

can you help my to edit your code to work with pytorch 1.7.0

thanks..... @Sibozhu .....

RalphMao commented 2 years ago

In 1.7.0 it is renamed from torch.rfft to torch.fft.rfft. Feel free to make changes and submit a PR

abbasaqeel commented 2 years ago

In 1.7.0 it is renamed from torch.rfft to torch.fft.rfft. Feel free to make changes and submit a PR

i make change as this w1_f = torch.fft.rfft(w1, dim=2, norm='ortho') * self.freq_coeff

but the error is size of freq_coef is not same size of output from torch.fft.rfft @RalphMao

abbasaqeel commented 2 years ago

@Sibozhu

abbasaqeel commented 2 years ago

@RalphMao

abbasaqeel commented 2 years ago

@RalphMao @Sibozhu i replace this line w1_f = torch.rfft(w1, signal_ndim=2, normalized=True, onesided=True) self.freq_coeff with this w1_f = torch.view_as_real(torch.fft.rfft(w1, 2, norm= 'ortho')) self.freq_coeff but the new error is The size of tensor a (2) must match the size of tensor b (5) at non-singleton dimension 3