We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import torch import torch.nn as nn import torch.fft
class GlobalFilter(nn.Module): def init(self, dim, h=14, w=8): super().init() self.complex_weight = nn.Parameter(torch.randn(h, w, dim, 2, dtype=torch.float32) * 0.02)
def forward(self, x): B, H, W, C = x.shape x = torch.fft.rfft2(x, dim=(1, 2), norm='ortho') weight = torch.view_as_complex(self.complex_weight) x = x * weight x = torch.fft.irfft2(x, s=(H, W), dim=(1, 2), norm='ortho') return x
Can you give a simple test for the dimensions' change?
The text was updated successfully, but these errors were encountered:
#13 (comment)
Sorry, something went wrong.
No branches or pull requests
import torch
import torch.nn as nn
import torch.fft
class GlobalFilter(nn.Module):
def init(self, dim, h=14, w=8):
super().init()
self.complex_weight = nn.Parameter(torch.randn(h, w, dim, 2, dtype=torch.float32) * 0.02)
Can you give a simple test for the dimensions' change?
The text was updated successfully, but these errors were encountered: