-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add Box impl #41
Add Box impl #41
Conversation
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.
I am not opposed to this, but the native index objects are already heap allocated and thus already "sort of" boxed. With this we are mostly creating a second dereferencing step. Is there a use case for this?
For erase type of index. Rust std. For code: let mut v: Vec<Box<dyn faiss::Index>> = vec![];
let f1 = FlatIndexImpl::new();
v.push(f1);
let f2 = IndexImpl::new();
v.push(f2); |
What if we also had a way to upcast a specific index type back to an let f1 = FlatIndex::new_l2(128);
let f2 = index_factory(128, "Flat", MetricType::L2);
let v: Vec<faiss::IndexImpl> = vec![
f1.upcast(),
f2,
]; |
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.
Looks OK to me nevertheless.
I agree.
|
Do |
I don't imagine this to be necessary. The operation is a |
No description provided.