MCPcopy Create free account
hub / github.com/evilsocket/cake / tensor_slice_bytes

Method tensor_slice_bytes

cake-core/src/utils/tensor_storage.rs:607–612  ·  view source on GitHub ↗
(&self, name: &str, byte_offset: usize, byte_len: usize)

Source from the content-addressed store, hash-verified

605
606 #[cfg(unix)]
607 fn tensor_slice_bytes(&self, name: &str, byte_offset: usize, byte_len: usize) -> Option<&[u8]> {
608 let meta = self.index.get(name)?;
609 let shard = self.shards.get(meta.shard_idx as usize)?;
610 let abs_offset = meta.abs_offset as usize + byte_offset;
611 Some(shard.as_slice(abs_offset as u64, byte_len))
612 }
613}
614
615#[cfg(test)]

Callers 1

get_expert_uncachedMethod · 0.45

Calls 2

as_sliceMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected