@@ -417,8 +417,7 @@ test_that("resample() works", {
417
417
expect_r6(rr , " ResampleResult" )
418
418
})
419
419
420
- test_that(" callr encapsulation and marshaling" , {
421
- skip_if_not_installed(" callr" )
420
+ test_that(" marshaling" , {
422
421
task = tsk(" mtcars" )$ filter(1 : 5 )
423
422
learner = lrn(" regr.mlp" , batch_size = 150 , epochs = 1 , device = " cpu" , encapsulate = c(train = " callr" ),
424
423
neurons = 20
@@ -427,14 +426,30 @@ test_that("callr encapsulation and marshaling", {
427
426
expect_false(learner $ marshaled )
428
427
learner $ marshal()$ unmarshal()
429
428
expect_prediction(learner $ predict(task ))
429
+ })
430
430
431
+ test_that(" callr encapsulation and marshaling" , {
432
+ skip_if_not_installed(" callr" )
433
+ task = tsk(" mtcars" )$ filter(1 : 5 )
431
434
learner = lrn(" regr.mlp" , batch_size = 150 , epochs = 1 , device = " cpu" , encapsulate = c(train = " callr" ),
432
435
neurons = 20
433
436
)
434
437
learner $ train(task )
435
438
expect_prediction(learner $ predict(task ))
436
439
})
437
440
441
+ test_that(" future and marshaling" , {
442
+ skip_if_not_installed(" future" )
443
+ task = tsk(" mtcars" )$ filter(1 : 5 )
444
+ learner = lrn(" regr.mlp" , batch_size = 150 , epochs = 1 , device = " cpu" ,
445
+ neurons = 20
446
+ )
447
+ rr = with_future(future :: multisession , {
448
+ resample(task , learner , rsmp(" holdout" ))
449
+ })
450
+ expect_class(rr , " ResampleResult" )
451
+ })
452
+
438
453
test_that(" Input verification works during `$train()` (train-predict shapes work together)" , {
439
454
task = nano_mnist()
440
455
0 commit comments