Skip to content

Commit dd844f7

Browse files
modified GitHub workflow action script test.yml
1 parent 2c6b102 commit dd844f7

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.github/workflows/test.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ jobs:
2222
python-version: ${{ matrix.python-version }}
2323

2424
- name: Install package
25-
run: pip install .
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -e .
2628
2729
- name: Run tests
28-
run: python -m unittest
30+
run: |
31+
pip install pytest
32+
pytest -ra --capture=no --showlocals

sparse_dot_topn/sparse_dot_topn_parallel.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// Modified by: Particular Miner
2121
// April 14, 2021
2222

23+
#include <cmath>
2324
#include <vector>
2425
#include <algorithm>
2526
#include <numeric>
@@ -398,7 +399,7 @@ int sparse_dot_topn_extd_parallel(
398399
std::vector<int> sub_total(n_jobs, 0);
399400
std::vector<int> split_n_minmax(n_jobs, 0);
400401

401-
int mem_sz_per_row = std::max(1, (int) ceil(((double) nnz_max)/((double) n_row)));
402+
int mem_sz_per_row = std::max(1, (int) std::ceil(((double) nnz_max)/((double) n_row)));
402403

403404
std::vector<std::thread> thread_list(n_jobs);
404405

sparse_dot_topn/test/test_awesome_cossim_topn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def test_awesome_cossim_top_large_matrix():
280280
# test with large matrix
281281
nr_vocab = 2 << 24
282282
density = 1e-6
283-
n_samples = 10000
283+
n_samples = 1000
284284
nnz = int(n_samples * nr_vocab * density)
285285

286286
rng1 = np.random.RandomState(42)

0 commit comments

Comments
 (0)