Skip to content

Commit ac0fd84

Browse files
committed
🚀 use NNlib's fast_act
1 parent 53627c5 commit ac0fd84

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

‎Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ CUDA = "3"
2020
FFTW = "1"
2121
Flux = "0.12"
2222
MAT = "0.10"
23-
NNlib = "0.7, 0.8"
23+
NNlib = "0.8"
2424
OMEinsum = "0.6"
2525
PkgTemplates = "0.7"
2626
Revise = "3"

‎src/FourierLayer.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ Flux.trainable(a::FourierLayer) = (a.Wf[:,:,1:a.λ], a.Wl,
9696
# The actual layer that does stuff
9797
function (a::FourierLayer)(x::AbstractArray)
9898
# Assign the parameters
99-
Wf, Wl, bf, bl, σ, = a.Wf, a.Wl, a.bf, a.bl, a.σ
99+
Wf, Wl, bf, bl, σ, = a.Wf, a.Wl, a.bf, a.bl, NNlib.fast_act(a.σ, x)
100+
100101
# Do a permutation: DataLoader requires batch to be the last dim
101102
# for the rest, it's more convenient to have it in the first one
102103
xp = permutedims(x, [3,1,2])

0 commit comments

Comments
 (0)