Skip to main content

check_dense_vector_value

Function check_dense_vector_value 

Source
pub fn check_dense_vector_value(
    value: &Value,
    dimensions: usize,
) -> Result<(), VectorDimError>
Expand description

Checks one dense vector value against a declared dimension count.

The per-token kernel behind DataType::check_vector_dims, exposed so the storage-layer converters can validate individual multi-vector tokens with the same semantics: Value::Null is accepted (a legal null row), a Value::Vector must have exactly dimensions elements, and a Value::List must additionally be all-numeric (Int or Float).

ยงErrors

Returns VectorDimError::WrongLength on a length mismatch (an empty list reports actual: 0), VectorDimError::NonNumericElement for a String, Null, or other non-numeric list element, and VectorDimError::NotAVector for any other value variant.