Skip to content

Commit 4e756c0

Browse files
committed
leakyrelu: fixed type conversion
1 parent 89eb296 commit 4e756c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/special/misc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ end
8787
pow_by_square(x, StaticInt(N))
8888
# @inline relu(x) = (y = zero(x); ifelse(x > y, x, y))
8989
@inline relu(x) = (y = zero(x); ifelse(x < y, y, x))
90-
@inline leakyrelu(x, a = 0.01) = (y = zero(x); ifelse(x < y, x*a, x))
90+
@inline leakyrelu(x, a = 0.01) = (y = zero(x); a = convert(typeof(x), a); ifelse(x < y, x*a, x))
9191

9292
Base.sign(v::AbstractSIMD) = ifelse(v > 0, one(v), -one(v))
9393

0 commit comments

Comments
 (0)