File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
6
6
Bijectors = " 76274a88-744f-5084-9051-94815aaf08c4"
7
7
Combinatorics = " 861a8166-3701-5b0c-9a16-15d98fcdc6aa"
8
8
Compat = " 34da2185-b29b-5c13-b0c7-acf172513d20"
9
+ DifferentiationInterface = " a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
9
10
Distributed = " 8ba89e20-285c-5b6f-9357-94700520ee1b"
10
11
Distributions = " 31c24e10-a181-5473-b8eb-7969acd0382f"
11
12
DistributionsAD = " ced4e74d-a319-5a8a-b0ac-84af2272839c"
Original file line number Diff line number Diff line change 31
31
θ = varinfo[:]
32
32
@test LogDensityProblems. logdensity (logdensity, θ) ≈ logjoint (model, varinfo)
33
33
@test LogDensityProblems. dimension (logdensity) == length (θ)
34
+
35
+ # Test a single backend on the generic
36
+ # ADgradient(::AbstractADType, ::LogDensityFunction) method. This really just
37
+ # checks that it runs at all.
38
+ if varinfo isa DynamicPPL. TypedVarInfo
39
+ ad = ADTypes. AutoMooncake (; config= nothing )
40
+ ∇ℓ = LogDensityProblemsAD. ADgradient (ad, logdensity)
41
+ @test isa (
42
+ LogDensityProblems. logdensity_and_gradient (∇ℓ, θ),
43
+ Tuple{Float64, Vector{Float64}},
44
+ )
45
+ end
34
46
end
35
47
end
36
48
end
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ using DynamicPPL
4
4
using AbstractMCMC
5
5
using AbstractPPL
6
6
using Bijectors
7
+ using DifferentiationInterface
7
8
using Distributions
8
9
using DistributionsAD
9
10
using Documenter
You can’t perform that action at this time.
0 commit comments