Skip to content

Commit

Permalink
Fix macOS error by running on CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
dfalbel committed Feb 28, 2024
1 parent 581a4e9 commit bf6bd24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/testthat/test-luz.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ luz_fit <- torch::nn_linear %>%
luz::setup(loss = torch::nnf_mse_loss, optimizer = torch::optim_sgd) %>%
luz::set_hparams(in_features = ncol(x_train), out_features = 1) %>%
luz::set_opt_hparams(lr = 0.01) %>%
luz::fit(list(x_train, y_train), verbose = FALSE, dataloader_options = list(batch_size = 5))
luz::fit(list(x_train, y_train), verbose = FALSE, dataloader_options = list(batch_size = 5),
accelerator = luz::accelerator(cpu = TRUE))

v <- vetiver_model(
luz_fit,
Expand Down

0 comments on commit bf6bd24

Please sign in to comment.