Skip to content

Commit c948864

Browse files
committed
define NNlib.leakyrelu(::AbstractSIMD) for Julia 1.6 test
1 parent 51ee029 commit c948864

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/forwarddiffext.jl

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ function tovec(x::ForwardDiff.Dual{T,V,N}) where {T,V,N}
1515
return ret
1616
end
1717

18+
if LoopVectorization.ifelse !== Base.ifelse
19+
@inline function NNlib.leakyrelu(x::LoopVectorization.AbstractSIMD, a=NNlib.oftf(x, NNlib.leakyrelu_a))
20+
LoopVectorization.ifelse(x>0, float(x), NNlib.oftf(x, a*x)) # max(a*x, x) is 3x slower
21+
end
22+
end
1823

1924
vx0 = randnvec()
2025
vx1 = randnvec()

0 commit comments

Comments
 (0)