Distance Module

View as Markdown

Rust module: cuvs::distance

Source: rust/cuvs/src/distance/mod.rs

pairwise_distance

1pub fn pairwise_distance(
2res: &Resources,
3x: &ManagedTensor,
4y: &ManagedTensor,
5distances: &ManagedTensor,
6metric: DistanceType,
7metric_arg: Option<f32>,
8) -> Result<()> { ... }

Compute pairwise distances between X and Y

Arguments

  • res - Resources to use
  • x - A matrix in device memory - shape (m, k)
  • y - A matrix in device memory - shape (n, k)
  • distances - A matrix in device memory that receives the output distances - shape (m, n)
  • metric - DistanceType to use for building the index
  • metric_arg - Optional value of p for Minkowski distances

Source: rust/cuvs/src/distance/mod.rs:21