Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
YichengDWu committed Aug 23, 2023
1 parent 2ddae9b commit bd895e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/chainrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function rrule(::typeof(extract_derivative), t::TaylorScalar{T, N},
end

function rrule(::typeof(*), A::AbstractMatrix{S},
t::AbstractVector{TaylorScalar{T, N}}) where {N, S <: Number, T}
t::AbstractVector{TaylorScalar{T, N}}) where {N, S <: Number, T}
project_A = ProjectTo(A)
function gemv_pullback(x̄)
= reinterpret(reshape, T, x̄)
Expand Down
4 changes: 2 additions & 2 deletions src/derivative.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function derivative end
end

@inline function derivative(f, x::AbstractVector{T}, l::AbstractVector{T},
order::Int64) where {T <: Number}
order::Int64) where {T <: Number}
derivative(f, x, l, Val{order + 1}())
end

Expand All @@ -32,7 +32,7 @@ end
make_taylor(t0::T, t1::T, ::Val{N}) where {T, N} = TaylorScalar{T, N}(t0, t1)

@inline function derivative(f, x::AbstractVector{T}, l::AbstractVector{T},
vN::Val{N}) where {T <: Number, N}
vN::Val{N}) where {T <: Number, N}
t = map((t0, t1) -> make_taylor(t0, t1, vN), x, l) # i.e. map(TaylorScalar{T, N}, x, l)
return extract_derivative(f(t), N)
end

0 comments on commit bd895e6

Please sign in to comment.