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

Function batch_encode_layout

nodedb-vector/src/quantize/binary.rs:146–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144
145 #[test]
146 fn batch_encode_layout() {
147 let v1 = [1.0f32, -1.0, 1.0, -1.0];
148 let v2 = [-1.0f32, 1.0, -1.0, 1.0];
149 let batch = encode_batch(&[&v1, &v2], 4);
150 assert_eq!(batch.len(), 2); // 2 vectors × 1 byte each
151 assert_eq!(batch[0], encode(&v1)[0]);
152 assert_eq!(batch[1], encode(&v2)[0]);
153 }
154}

Callers

nothing calls this directly

Calls 1

encode_batchFunction · 0.70

Tested by

no test coverage detected