Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: benfred/implicit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: benfred/implicit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix_overflow_warning
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on May 7, 2026

  1. Fix overflow warning in nearest neighbors code

    During the unittest we were seeing a warning saying
    
    ```
    tests/knn_test.py::BM25Test::test_rank_items_batch
    tests/knn_test.py::BM25Test::test_similar_items_filter
    tests/knn_test.py::TFIDFTest::test_rank_items_batch
    tests/knn_test.py::TFIDFTest::test_similar_items_filter
    tests/knn_test.py::CosineTest::test_rank_items_batch
    tests/knn_test.py::CosineTest::test_similar_items_filter
      /home/ben/code/implicit/implicit/utils.py:134: RuntimeWarning: overflow encountered in cast
        output_scores[i] = batch_scores[:N]
    ```
    
    This is because the `_batch_call` was generating output in float32, but the
    KNN models were returning float64 results. Fix.
    benfred committed May 7, 2026
    Configuration menu
    Copy the full SHA
    0065022 View commit details
    Browse the repository at this point in the history
Loading