Skip to content

Commit fcbaf7f

Browse files
committed
format
1 parent 3ebff98 commit fcbaf7f

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

ext/TaylorDiffNNlibExt.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ using TaylorDiff
44
import NNlib: oftf
55
import NNlib: sigmoid_fast, tanh_fast, rrelu, leakyrelu
66

7-
87
@inline sigmoid_fast(t::TaylorScalar) = one(t) / (one(t) + exp(-t))
98

109
@inline tanh_fast(t::TaylorScalar) = tanh(t)
1110

12-
@inline function rrelu(t::TaylorScalar{T, N}, l=oftf(t, 1/8), u=oftf(t, 1/3)) where {T, N}
11+
@inline function rrelu(t::TaylorScalar{T, N},
12+
l = oftf(t, 1 / 8),
13+
u = oftf(t, 1 / 3)) where {T, N}
1314
a = (u - l) * rand(float(T)) + l
1415
return leakyrelu(t, a)
1516
end
1617

17-
end
18+
end

src/codegen.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ for func in (+, -, deg2rad, rad2deg,
1111
asin, acos, atan, asec, acsc, acot,
1212
log, log10, log1p, log2,
1313
asinh, acosh, atanh, asech, acsch,
14-
acoth,
14+
acoth,
1515
abs, sign)
1616
F = typeof(func)
1717
# base case

src/scalar.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,6 @@ for op in (:+, :-, :*, :/)
8989
end
9090
transpose(t::TaylorScalar) = t
9191

92-
Base.AbstractFloat(x::TaylorScalar{T, N}) where {T, N} = TaylorScalar{Float64, N}(convert(NTuple{N, Float64}, x.value))
92+
function Base.AbstractFloat(x::TaylorScalar{T, N}) where {T, N}
93+
TaylorScalar{Float64, N}(convert(NTuple{N, Float64}, x.value))
94+
end

0 commit comments

Comments
 (0)