MmapTensorSource
A handle to a memory-mapped file region that can provide tensor views.
This class manages the lifecycle of a memory-mapped file and provides methods to create tensor views into specific regions of the mapped data.
Usage:
val mmap = MmapTensorSource.fromFile(file)
val tensor1 = mmap.tensorAt<FP32>(offset1, shape1)
val tensor2 = mmap.tensorAt<FP32>(offset2, shape2)
// tensors share the same underlying memory-mapped region
mmap.close() // release when doneContent copied to clipboard
Parameters
mappedBuffer
the memory-mapped buffer for the entire file or region