Export all vectors as F32 for snapshot transfer. For F32 indexes this is a clone. For F16/BF16 indexes each vector is decoded to F32 on the fly.
(&self)
| 323 | /// For F32 indexes this is a clone. For F16/BF16 indexes each vector is |
| 324 | /// decoded to F32 on the fly. |
| 325 | pub fn export_vectors(&self) -> Vec<Vec<f32>> { |
| 326 | self.nodes |
| 327 | .iter() |
| 328 | .map(|n| match &n.storage { |
| 329 | NodeStorage::F32(v) => v.clone(), |
| 330 | NodeStorage::Bytes { dtype, bytes } => { |
| 331 | crate::dtype::cast_to_f32(bytes, *dtype, self.dim) |
| 332 | .expect("export_vectors: byte-length invariant violated") |
| 333 | } |
| 334 | }) |
| 335 | .collect() |
| 336 | } |
| 337 | |
| 338 | /// Export all neighbor lists for snapshot transfer. |
| 339 | pub fn export_neighbors(&self) -> Vec<Vec<Vec<u32>>> { |
no test coverage detected