Skip to main content

Module distance

Module distance 

Source
Expand description

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.

Enums§

DistanceError
Error type for pairwise distance operations.
DistanceType
Distance metric used for building and searching nearest neighbor indices.

Functions§

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.