Skip to content

Commit

Permalink
Restrict types in logdet (#245)
Browse files Browse the repository at this point in the history
* Restrict types in logdet

* Bump patch

Co-authored-by: wt <will.tebbutt@invenialabs.co.uk>
  • Loading branch information
willtebbutt and willtebbutt committed Aug 17, 2020
1 parent 15add9b commit d55540a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ChainRules"
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
version = "0.7.12"
version = "0.7.13"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
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

2 comments on commit d55540a

@willtebbutt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/19658

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.13 -m "<description of version>" d55540a7c836e96f9f5e46cabe0b5e49d789587c
git push origin v0.7.13

Please sign in to comment.