Add support functions for accessing arroy writers and readers

This commit is contained in:
Louis Dureuil 2024-05-28 14:22:19 +02:00
parent e172e938e7
commit d35278320e
No known key found for this signature in database
5 changed files with 28 additions and 26 deletions

View file

@ -442,3 +442,9 @@ impl DistributionShift {
pub const fn is_cuda_enabled() -> bool {
cfg!(feature = "cuda")
}
pub fn arroy_db_range_for_embedder(embedder_id: u8) -> impl Iterator<Item = u16> {
let embedder_id = (embedder_id as u16) << 8;
(0..=u8::MAX).map(move |k| embedder_id | (k as u16))
}