pub struct Index(/* private fields */);Expand description
Ivf-Flat ANN Index
Implementations§
Source§impl Index
impl Index
Sourcepub fn build<T: Into<ManagedTensor>>(
res: &Resources,
params: &IndexParams,
dataset: T,
) -> Result<Index>
pub fn build<T: Into<ManagedTensor>>( res: &Resources, params: &IndexParams, dataset: T, ) -> Result<Index>
Builds a new Index from the dataset for efficient search.
§Arguments
res- Resources to useparams- Parameters for building the indexdataset- A row-major matrix on either the host or device to index
Sourcepub fn search(
self,
res: &Resources,
params: &SearchParams,
queries: &ManagedTensor,
neighbors: &ManagedTensor,
distances: &ManagedTensor,
) -> Result<()>
pub fn search( self, res: &Resources, params: &SearchParams, queries: &ManagedTensor, neighbors: &ManagedTensor, distances: &ManagedTensor, ) -> Result<()>
Perform a Approximate Nearest Neighbors search on the Index
§Arguments
res- Resources to useparams- Parameters to use in searching the indexqueries- A matrix in device memory to query forneighbors- Matrix in device memory that receives the indices of the nearest neighborsdistances- Matrix in device memory that receives the distances of the nearest neighbors
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl !Send for Index
impl !Sync for Index
impl Unpin for Index
impl UnwindSafe for Index
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more