Skip to content

Commit c43d0f5

Browse files
committed
Test waic.function core support
1 parent eba8027 commit c43d0f5

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/testthat/test_loo_and_waic.R

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,22 @@ test_that("loo.function runs with multiple cores", {
223223
expect_identical(loo_with_fn2$estimates, loo_with_fn1$estimates)
224224
})
225225

226+
test_that("waic.function runs with multiple cores", {
227+
waic_with_fn1 <- waic(
228+
llfun,
229+
data = data,
230+
draws = draws,
231+
cores = 1
232+
)
233+
waic_with_fn2 <- waic(
234+
llfun,
235+
data = data,
236+
draws = draws,
237+
cores = 2
238+
)
239+
expect_identical(waic_with_fn2$estimates, waic_with_fn1$estimates)
240+
})
241+
226242
test_that("save_psis option to loo.function makes correct psis object", {
227243
loo_with_fn2 <- loo.function(
228244
llfun,

0 commit comments

Comments
 (0)