Skip to content

Commit c7ad3ea

Browse files
committed
fix: ordering
1 parent df901ba commit c7ad3ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/ReactantNNlibExt/Implementations.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ if isdefined(NNlib, :gelu_tanh)
1313
α = NNlib.oftf(x, 0.044715)
1414
half = NNlib.oftf(x, 0.5)
1515
λ = sqrt(NNlib.oftf(x, 2 / pi))
16-
return x * half * (1 + tanh* (x + α * x^3)))
16+
return x * (half * (1 + tanh* (x + α * x^3))))
1717
end
1818
else
1919
# Older versions of NNlib do not have gelu_tanh (gelu refers to the tanh version)
2020
function NNlib.gelu(x::TracedRNumber)
2121
α = NNlib.oftf(x, 0.044715)
2222
half = NNlib.oftf(x, 0.5)
2323
λ = sqrt(NNlib.oftf(x, 2 / pi))
24-
return x * half * (1 + tanh* (x + α * x^3)))
24+
return x * (half * (1 + tanh* (x + α * x^3))))
2525
end
2626
end
2727

0 commit comments

Comments
 (0)