Skip to content

Commit 715aefa

Browse files
committed
Fix inplace mistake for theta
1 parent 5619cc4 commit 715aefa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/abstractmcmc.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ function AbstractMCMC.step(
292292
logdensity_and_gradient = Base.Fix1(
293293
LogDensityProblems.logdensity_and_gradient, model.logdensity
294294
)
295-
θ = t_old.z.θ
295+
θ = copy(t_old.z.θ)
296296
grad = last(logdensity_and_gradient(θ))
297297

298298
# Update latent variables and velocity according to
@@ -304,7 +304,8 @@ function AbstractMCMC.step(
304304
θ .+= newv
305305

306306
# Make new transition.
307-
t = transition(rng, h, κ, t_old.z)
307+
z = phasepoint(h, θ, v)
308+
t = transition(rng, h, κ, z)
308309

309310
# Adapt h and spl.
310311
tstat = stat(t)

0 commit comments

Comments
 (0)