Struct Index

Source
pub struct Index(/* private fields */);
Expand description

Ivf-Flat ANN Index

Implementations§

Source§

impl Index

Source

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 use
  • params - Parameters for building the index
  • dataset - A row-major matrix on either the host or device to index
Source

pub fn new() -> Result<Index>

Creates a new empty index

Source

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 use
  • params - Parameters to use in searching the index
  • queries - A matrix in device memory to query for
  • neighbors - Matrix in device memory that receives the indices of the nearest neighbors
  • distances - Matrix in device memory that receives the distances of the nearest neighbors

Trait Implementations§

Source§

impl Debug for Index

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Index

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.