Skip to content

Commit

Permalink
Use CR adjoint for logdet(::Cholesky) (#1226)
Browse files Browse the repository at this point in the history
* Use CR adjoint for `logdet(::Cholesky)`

* Update Project.toml

* Update ci.yml

* Update Project.toml
  • Loading branch information
devmotion authored Jun 20, 2022
1 parent ff57997 commit 3239330
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.3' # Replace this with the minimum Julia version that your package supports.
- '1.6' # Replace this with the minimum Julia version that your package supports.
- '1' # automatically expands to the latest stable 1.x release of Julia
- 'nightly'
os:
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"

[compat]
AbstractFFTs = "0.5, 1.0"
ChainRules = "1.5"
ChainRules = "1.33"
ChainRulesCore = "1.9"
ChainRulesTestUtils = "1"
DiffRules = "1.4"
Expand All @@ -38,7 +38,7 @@ NaNMath = "0.3, 1"
Requires = "1.1"
SpecialFunctions = "1.6, 2"
ZygoteRules = "0.2.1"
julia = "1.3"
julia = "1.6"

[extras]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Expand Down
6 changes: 0 additions & 6 deletions src/lib/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -741,12 +741,6 @@ end
end
end

@adjoint function logdet(C::Cholesky)
return logdet(C), function(Δ)
return ((uplo=nothing, info=nothing, factors=Diagonal(2 .* Δ ./ diag(C.factors))),)
end
end

@adjoint function Matrix(S::UniformScaling, i::Integer, j::Integer)
return Matrix(S, i, j), Δ -> ((λ=tr(Δ),), nothing, nothing)
end
Expand Down

0 comments on commit 3239330

Please sign in to comment.