Skip to content

Commit a90e6f5

Browse files
committed
Change test to use linked
1 parent 5ff05e8 commit a90e6f5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/ad.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ using DynamicPPL: LogDensityFunction
2323
varinfos = DynamicPPL.TestUtils.setup_varinfos(m, rand_param_values, vns)
2424

2525
@testset "$(short_varinfo_name(varinfo))" for varinfo in varinfos
26-
# TODO: This runs unlinked. Should we test linked as well?
26+
# TODO: This runs linked. Should we test unlinked as well?
27+
varinfo = DynamicPPL.link(varinfo, m)
2728
f = LogDensityFunction(m, varinfo)
2829
x = DynamicPPL.getparams(f)
2930
# Calculate reference logp + gradient of logp using ForwardDiff
@@ -57,14 +58,15 @@ using DynamicPPL: LogDensityFunction
5758
ref_ldf, adtype
5859
)
5960
else
60-
# TODO: Should we test linked as well?
61-
DynamicPPL.TestUtils.AD.run_ad(
61+
# TODO: Should we test unlinked as well?
62+
@test DynamicPPL.TestUtils.AD.run_ad(
6263
m,
6364
adtype;
64-
linked=false,
65+
test=true,
66+
benchmark=true,
6567
varinfo=varinfo,
6668
expected_value_and_grad=(ref_logp, ref_grad),
67-
)
69+
) isa Any
6870
end
6971
end
7072
end

0 commit comments

Comments
 (0)