Skip to content

Commit 0dfa176

Browse files
authored
Merge pull request #148 from st--/st/ad_workaround
AD workaround
2 parents 635a957 + 541c606 commit 0dfa176

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/chol.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ chol_lower(a::Cholesky) = a.uplo === 'L' ? a.L : a.U'
44
chol_upper(a::Cholesky) = a.uplo === 'U' ? a.U : a.L'
55

66
# For a dense Matrix, the following allows us to avoid the Adjoint wrapper:
7-
chol_lower(a::Matrix) = cholesky(Hermitian(a, :L)).L
7+
chol_lower(a::Matrix) = cholesky(Symmetric(a, :L)).L
8+
# NOTE: Formally, the line above should use Hermitian() instead of Symmetric(),
9+
# but this currently has an AutoDiff issue in Zygote.jl, and PDMat is
10+
# type-restricted to be Real, so they are equivalent.
811

912
if HAVE_CHOLMOD
1013
CholTypeSparse{T} = SuiteSparse.CHOLMOD.Factor{T}

0 commit comments

Comments
 (0)