Skip to content

Commit

Permalink
fix multicores when using the torch model
Browse files Browse the repository at this point in the history
  • Loading branch information
M3nin0 committed Jul 29, 2024
1 parent 061a438 commit 790b947
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/sits_classify.R
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ sits_classify.raster_cube <- function(data,
proc_bloat = proc_bloat
)
# Update multicores parameter
if ("xgb_model" %in% .ml_class(ml_model) || .is_torch_model(ml_model))
if ("xgb_model" %in% .ml_class(ml_model))
multicores <- 1
else if (.torch_mps_enabled(ml_model) || .torch_cuda_enabled(ml_model))
multicores <- 1
else
# Update multicores parameter
Expand Down

0 comments on commit 790b947

Please sign in to comment.