Skip to content

Commit

Permalink
Restrict types in logdet
Browse files Browse the repository at this point in the history
  • Loading branch information
willtebbutt committed Aug 17, 2020
1 parent 15add9b commit 3e2d647
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rulesets/LinearAlgebra/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ end
##### `logdet`
#####

function frule((_, Δx), ::typeof(logdet), x::Union{Number, AbstractMatrix})
function frule((_, Δx), ::typeof(logdet), x::Union{Number, StridedMatrix{<:Number}})
Ω = logdet(x)
return Ω, tr(x \ Δx)
end

function rrule(::typeof(logdet), x::Union{Number, AbstractMatrix})
function rrule(::typeof(logdet), x::Union{Number, StridedMatrix{<:Number}})
Ω = logdet(x)
function logdet_pullback(ΔΩ)
∂x = x isa Number ? ΔΩ / x' : ΔΩ * inv(x)'
Expand Down

0 comments on commit 3e2d647

Please sign in to comment.