[R] Don't cap global number of threads for serialization (#10028)

This commit is contained in:
david-cortes
2024-02-20 04:13:00 +01:00
committed by GitHub
parent edf501d227
commit 6e3c899ba7
18 changed files with 37 additions and 20 deletions

View File

@@ -55,6 +55,8 @@ print(paste("test-error=", err))
# save model to binary local file
xgb.save(bst, "xgboost.model")
# load binary model to R
# Function doesn't take 'nthreads', but can be set like this:
RhpcBLASctl::omp_set_num_threads(1)
bst2 <- xgb.load("xgboost.model")
pred2 <- predict(bst2, test$data)
# pred2 should be identical to pred