MCPcopy Create free account
hub / github.com/acking-you/static_flow / value_vector

Function value_vector

crates/store/src/lancedb_api.rs:3180–3194  ·  view source on GitHub ↗
(array: &FixedSizeListArray, row: usize)

Source from the content-addressed store, hash-verified

3178}
3179
3180fn value_vector(array: &FixedSizeListArray, row: usize) -> Vec<f32> {
3181 let values = array.values();
3182 let values = values
3183 .as_any()
3184 .downcast_ref::<Float32Array>()
3185 .unwrap_or_else(|| panic!("vector values are not Float32Array"));
3186
3187 let dim = array.value_length() as usize;
3188 let start = row * dim;
3189 let mut vector = Vec::with_capacity(dim);
3190 for idx in 0..dim {
3191 vector.push(values.value(start + idx));
3192 }
3193 vector
3194}
3195
3196fn image_mime_type(filename: &str) -> &'static str {
3197 match filename.split('.').next_back() {

Callers 1

extract_vectorFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected