Skip to content

Commit a86b716

Browse files
committed
Use new DI patch
1 parent a7852b6 commit a86b716

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ AdvancedHMC = "0.6, 0.7, 0.8"
3333
ChainRulesTestUtils = "0.7, 1"
3434
ChangesOfVariables = "0.1"
3535
Combinatorics = "1.0.2"
36+
DifferentiationInterface = "0.7.7"
3637
DistributionsAD = "0.6.3"
3738
Documenter = "1"
3839
Enzyme = "0.13.12"

test/ad/corr.jl

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,11 @@ end
3434
cholesky_to_triangular =
3535
uplo == 'U' ? Bijectors.cholesky_upper : Bijectors.cholesky_lower
3636

37-
if adtype isa AutoEnzyme{<:ForwardMode} && d == 1
38-
# For d == 1, y has length 0, and DI doesn't handle this well
39-
# https://github.com/JuliaDiff/DifferentiationInterface.jl/issues/802
40-
@test_throws DivideError test_ad(y -> sum(transform(b, binv(y))), adtype, y)
41-
@test_throws DivideError test_ad(
42-
y -> sum(cholesky_to_triangular(transform(binv, y))), adtype, y
43-
)
44-
else
45-
# roundtrip
46-
test_ad(y -> sum(transform(b, binv(y))), adtype, y)
47-
# inverse (we need to tack on `cholesky_upper`/`cholesky_lower`,
48-
# because directly calling `sum` on a LinearAlgebra.Cholesky doesn't
49-
# give a scalar)
50-
test_ad(y -> sum(cholesky_to_triangular(transform(binv, y))), adtype, y)
51-
end
37+
# roundtrip
38+
test_ad(y -> sum(transform(b, binv(y))), adtype, y)
39+
# inverse (we need to tack on `cholesky_upper`/`cholesky_lower`,
40+
# because directly calling `sum` on a LinearAlgebra.Cholesky doesn't
41+
# give a scalar)
42+
test_ad(y -> sum(cholesky_to_triangular(transform(binv, y))), adtype, y)
5243
end
5344
end

0 commit comments

Comments
 (0)