-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support numpy array to sparse dataset in pyknowhere api #654
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chasingegg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #654 +/- ##
=========================================
+ Coverage 0 71.40% +71.40%
=========================================
Files 0 69 +69
Lines 0 4728 +4728
=========================================
+ Hits 0 3376 +3376
- Misses 0 1352 +1352 |
python/knowhere/knowhere.i
Outdated
@@ -355,6 +359,39 @@ CurrentVersion() { | |||
return knowhere::Version::GetCurrentVersion().VersionNumber(); | |||
} | |||
|
|||
knowhere::DataSetPtr | |||
Array2SparseDataSet(float* data, int nb1, int* ids, int nb2, int64_t* indptr, int nrow) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename nrow
since it doesn't mean nrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to nb3
python/knowhere/knowhere.i
Outdated
int64_t start = indptr[i]; | ||
int64_t end = indptr[i+1]; | ||
if (start == end) { | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually we don't allow empty row. let's throw an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
look good to me overall, with nits |
Signed-off-by: chasingegg <chao.gao@zilliz.com>
/lgtm |
…#654) Signed-off-by: chasingegg <chao.gao@zilliz.com>
/kind improvement