Skip to content
This repository was archived by the owner on Sep 28, 2024. It is now read-only.

Commit 93e1b64

Browse files
committed
fix
fix fix
1 parent e309f0f commit 93e1b64

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/fourier.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ struct SpectralConv{P, N, T, S, F}
88
out_channel::S
99
modes::NTuple{N, S}
1010
σ::F
11+
end
1112

12-
function SpectralConv(
13-
permuted::Bool,
14-
weight::T,
15-
in_channel::S,
16-
out_channel::S,
17-
modes::NTuple{N, S},
18-
σ::F
19-
) where {N, T, S, F}
20-
return new{permuted, N, T, S, F}(weight, in_channel, out_channel, modes, σ)
21-
end
13+
function SpectralConv{P}(
14+
weight::T,
15+
in_channel::S,
16+
out_channel::S,
17+
modes::NTuple{N, S},
18+
σ::F
19+
) where {P, N, T, S, F}
20+
return SpectralConv{P, N, T, S, F}(weight, in_channel, out_channel, modes, σ)
2221
end
2322

2423
"""
@@ -62,10 +61,11 @@ function SpectralConv(
6261
scale = one(T) / (in_chs * out_chs)
6362
weights = scale * init(out_chs, in_chs, prod(modes))
6463

65-
return SpectralConv(permuted, weights, in_chs, out_chs, modes, σ)
64+
return SpectralConv{permuted}(weights, in_chs, out_chs, modes, σ)
6665
end
6766

68-
Flux.@functor SpectralConv
67+
Flux.@functor SpectralConv{true}
68+
Flux.@functor SpectralConv{false}
6969

7070
Base.ndims(::SpectralConv{P, N}) where {P, N} = N
7171

0 commit comments

Comments
 (0)