Skip to content

Commit 50c8598

Browse files
committed
Also pass varinfo to LogDensityFunction
1 parent b317ab2 commit 50c8598

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test_utils/ad.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function run_ad(
138138
verbose && @info "Running AD on $(model.f) with $(adtype)\n"
139139
params = map(identity, params)
140140
verbose && println(" params : $(params)")
141-
ldf = LogDensityFunction(model; adtype=adtype)
141+
ldf = LogDensityFunction(model, varinfo; adtype=adtype)
142142

143143
value, grad = logdensity_and_gradient(ldf, params)
144144
grad = _to_vec_f64(grad)
@@ -147,7 +147,7 @@ function run_ad(
147147
if test
148148
# Calculate ground truth to compare against
149149
value_true, grad_true = if expected_value_and_grad === nothing
150-
ldf_reference = LogDensityFunction(model; adtype=reference_adtype)
150+
ldf_reference = LogDensityFunction(model, varinfo; adtype=reference_adtype)
151151
logdensity_and_gradient(ldf_reference, params)
152152
else
153153
expected_value_and_grad

0 commit comments

Comments
 (0)