MCPcopy Create free account
hub / github.com/Anoise/WTFlib / forward

Method forward

LDPS_Graph/layers/MultiWaveletCorrelation.py:279–292  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

277 return torch.einsum("bix,iox->box", x, weights)
278
279 def forward(self, x):
280 B, N, c, k = x.shape # (B, N, c, k)
281
282 x = x.view(B, N, -1)
283 x = x.permute(0, 2, 1)
284 x_fft = torch.fft.rfft(x)
285 # Multiply relevant Fourier modes
286 l = min(self.modes1, N // 2 + 1)
287 # l = N//2+1
288 out_ft = torch.zeros(B, c * k, N // 2 + 1, device=x.device, dtype=torch.cfloat)
289 out_ft[:, :, :l] = self.compl_mul1d(x_fft[:, :, :l], self.weights1[:, :, :l])
290 x = torch.fft.irfft(out_ft, n=N)
291 x = x.permute(0, 2, 1).view(B, N, c, k)
292 return x
293
294
295# ##

Callers

nothing calls this directly

Calls 1

compl_mul1dMethod · 0.95

Tested by

no test coverage detected