Distance Module
Rust module: cuvs::distance
Source: rust/cuvs/src/distance/mod.rs
Distance metrics and pairwise distance computation.
[DistanceType] selects the metric used by every index and by
[pairwise_distance]. Inputs and output are borrowed through the
AsDlTensor / AsDlTensorMut traits; see the dlpack
module for the tensor model.
DistanceType
Distance metric used for building and searching nearest neighbor indices.
Source: rust/cuvs/src/distance/mod.rs:22
DistanceError
Error type for pairwise distance operations.
Source: rust/cuvs/src/distance/mod.rs:143
pairwise_distance
Computes all pairwise distances between the rows of x (shape m × k) and
y (shape n × k), writing the m × n result into distances.
x, y, and distances reside in device memory and implement
[AsDlTensor] / [AsDlTensorMut]. metric selects the distance; use
[DistanceType::LpUnexpanded] to supply the Minkowski exponent p (all
other metrics use the C API default).
Source: rust/cuvs/src/distance/mod.rs:159