Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HFM may not be available due to compatibility issues #36

Closed
LiangcaiSu opened this issue Dec 5, 2022 · 1 comment
Closed

HFM may not be available due to compatibility issues #36

LiangcaiSu opened this issue Dec 5, 2022 · 1 comment

Comments

@LiangcaiSu
Copy link
Contributor

HFM adopts HolographicInteractionLayer in fuxictr/pytorch/layers/interaction.py.

However, HolographicInteractionLayer may be not available in Pytorch 1.10 because torch.rfft/torch.irfft has changed.\

Here is a solution for reference:

try:
    from torch import irfft
    from torch import rfft
except ImportError:
    from torch.fft import irfft2
    from torch.fft import rfft2
    def rfft(x, d):
        t = rfft2(x, dim = (-d))
        return torch.stack((t.real, t.imag), -1)
    def irfft(x, d, signal_sizes):
        return irfft2(torch.complex(x[:,:,0], x[:,:,1]), s = signal_sizes, dim = (-d))
@zhujiem
Copy link
Contributor

zhujiem commented Dec 5, 2022

The issue has been fixed in FuxiCTR v2, which supports pytorch 1.10.

@zhujiem zhujiem closed this as completed Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants