Skip to content

Commit c99e006

Browse files
committed
refactor: remove copy
Signed-off-by: Kai Xu <[email protected]>
1 parent 2cb2d9e commit c99e006

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/riemannian/integrator.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function step(
4848
# Tempering
4949
#r = temper(lf, r, (i=i, is_half=true), n_steps)
5050
# eq (16) of Girolami & Calderhead (2011)
51-
r_half = copy(r_init)
51+
r_half = r_init
5252
local cache
5353
for j = 1:lf.n
5454
# Reuse cache for the first iteration
@@ -63,7 +63,7 @@ function step(
6363
r_half = r_init - ϵ / 2 * gradient
6464
end
6565
# eq (17) of Girolami & Calderhead (2011)
66-
θ_full = copy(θ_init)
66+
θ_full = θ_init
6767
term_1 = ∂H∂r(h, θ_init, r_half) # unchanged across the loop
6868
for j = 1:lf.n
6969
θ_full = θ_init + ϵ / 2 * (term_1 + ∂H∂r(h, θ_full, r_half))

0 commit comments

Comments
 (0)