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

Function batch_encode

nodedb-vector/src/quantize/pq.rs:441–448  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

439
440 #[test]
441 fn batch_encode() {
442 let vecs = make_clustered_data();
443 let refs: Vec<&[f32]> = vecs.iter().map(|v| v.as_slice()).collect();
444 let codec = PqCodec::train(&refs, 4, 2, 16, 10);
445
446 let batch = codec.encode_batch(&refs).unwrap();
447 assert_eq!(batch.len(), 2 * 200); // M=2, N=200
448 }
449
450 // golden format test — verifies the on-disk layout is stable.
451 #[test]

Callers

nothing calls this directly

Calls 5

make_clustered_dataFunction · 0.85
collectMethod · 0.80
encode_batchMethod · 0.80
iterMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected