MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / make_sq8

Function make_sq8

nodedb-vector/src/codec_index/build.rs:260–266  ·  view source on GitHub ↗
(dim: usize, n: usize)

Source from the content-addressed store, hash-verified

258 use crate::quantize::Sq8Codec;
259
260 fn make_sq8(dim: usize, n: usize) -> Sq8Codec {
261 let vecs: Vec<Vec<f32>> = (0..n)
262 .map(|i| (0..dim).map(|d| (i * dim + d) as f32 * 0.1).collect())
263 .collect();
264 let refs: Vec<&[f32]> = vecs.iter().map(|v| v.as_slice()).collect();
265 Sq8Codec::calibrate(&refs, dim)
266 }
267
268 #[test]
269 fn insert_sets_entry_point() {

Callers 2

insert_sets_entry_pointFunction · 0.70

Calls 3

collectMethod · 0.80
iterMethod · 0.45
as_sliceMethod · 0.45

Tested by 2

insert_sets_entry_pointFunction · 0.56