lance_linalg::distance::cosine

Function cosine_distance_arrow_batch

Source
pub fn cosine_distance_arrow_batch(
    from: &dyn Array,
    to: &FixedSizeListArray,
) -> Result<Arc<Float32Array>>
Expand description

Compute Cosine distance between a vector and a batch of vectors.

Null buffer of to is propagated to the returned array.

Parameters

  • from: the vector to compute distance from.
  • to: a list of vectors to compute distance to.

ยงPanics

Panics if the length of from is not equal to the dimension (value length) of to.