Skip to content

Commit

Permalink
umap2: ensure n_sgd_threads matches n_threads
Browse files Browse the repository at this point in the history
  • Loading branch information
jlmelville committed May 18, 2024
1 parent 60116b0 commit 98501a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# uwot (development version)

## Bug fixes and minor improvements

* Setting `num_threads` directly in `umap2` did not result in the sgd threads
being updated to that value when `batch = TRUE`, which it should have been.

# uwot 0.2.2

## Bug fixes and minor improvements
Expand Down
6 changes: 3 additions & 3 deletions R/umap2.R
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,9 @@ umap2 <-

if (is.null(n_threads)) {
n_threads <- default_num_threads()
if (batch) {
n_sgd_threads <- n_threads
}
}
if (batch && is.numeric(n_sgd_threads) && n_sgd_threads == 0) {
n_sgd_threads <- n_threads
}

if (is_sparse_matrix(X)) {
Expand Down

0 comments on commit 98501a8

Please sign in to comment.