File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -203,8 +203,19 @@ using Turing
203
203
return 10 ~ Normal (x)
204
204
end
205
205
chn1 = sample (StableRNG (468 ), f (), NUTS (), 100 ; save_state= true )
206
- chn2 = sample (StableRNG (468 ), f (), NUTS (), 10 ; initial_state= chn1. info. samplerstate)
207
- @test isapprox (chn1[:x ], 5.0 ; atol= 2.0 )
206
+ # chn1 should end up around x = 5.
207
+ chn2 = sample (
208
+ StableRNG (468 ),
209
+ f (),
210
+ NUTS (),
211
+ 10 ;
212
+ nadapts= 0 ,
213
+ discard_adapt= false ,
214
+ initial_state= chn1. info. samplerstate,
215
+ )
216
+ # if chn2 uses initial_state, its first sample should be somewhere around 5. if
217
+ # initial_state isn't used, it will be sampled from [-2, 2] so this test should fail
218
+ @test isapprox (chn2[:x ][1 ], 5.0 ; atol= 2.0 )
208
219
end
209
220
210
221
@testset " (partially) issue: #2095" begin
You can’t perform that action at this time.
0 commit comments