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

Method read_tensor_slice

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

Source from the content-addressed store, hash-verified

594 }
595
596 fn read_tensor_slice(&self, name: &str, byte_offset: usize, byte_len: usize) -> Option<Vec<u8>> {
597 let meta = self.index.get(name)?;
598 let shard = self.shards.get(meta.shard_idx as usize)?;
599 let abs_offset = meta.abs_offset as usize + byte_offset;
600 #[cfg(unix)]
601 { Some(shard.read_bytes(abs_offset as u64, byte_len)) }
602 #[cfg(not(unix))]
603 { None }
604 }
605
606 #[cfg(unix)]
607 fn tensor_slice_bytes(&self, name: &str, byte_offset: usize, byte_len: usize) -> Option<&[u8]> {

Callers

nothing calls this directly

Calls 2

read_bytesMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected