MmapTensorStorage
MmapTensorStorage
TensorData storage backed by a SharedMmapBlockCache. More…
#include <MmapTensorStorage.hpp>
Inherits from TensorStorageBase< MmapTensorStorage >
Public Functions
| Name | |
|---|---|
| MmapTensorStorage(std::shared_ptr< SharedMmapBlockCache const > cache) | |
| ~MmapTensorStorage() =default | |
| float | getValueAtImpl(std::span< std::size_t const > indices) const |
| std::span< float const > | flatDataImpl() const |
| std::vector< float > | sliceAlongAxisImpl(std::size_t axis, std::size_t index) const |
| std::vector< float > | getColumnImpl(std::size_t col) const |
| std::vector< std::size_t > | shapeImpl() const |
| std::size_t | totalElementsImpl() const |
| bool | isContiguousImpl() const |
| TensorStorageType | getStorageTypeImpl() const |
| TensorStorageCache | tryGetCacheImpl() const |
| std::shared_ptr< SharedMmapBlockCache const > const & | cache() const |
Additional inherited members
Public Functions inherited from TensorStorageBase< MmapTensorStorage >
| Name | |
|---|---|
| float | getValueAt(std::span< std::size_t const > indices) const Get a single float value by multi-dimensional index. |
| std::span< float const > | flatData() const Get a span over the flat (row-major) data. |
| std::vector< float > | sliceAlongAxis(std::size_t axis, std::size_t index) const Extract a sub-tensor by fixing one axis to a single index. |
| std::vector< float > | getColumn(std::size_t col) const Get a single column (axis 1 slice) across all rows (axis 0). |
| std::vector< std::size_t > | shape() const Get the shape as a vector of sizes (one per axis). |
| std::size_t | totalElements() const Get the total number of elements (product of shape). |
| bool | isContiguous() const Whether the underlying data is contiguous in memory. |
| TensorStorageType | getStorageType() const Get the storage type identifier. |
| TensorStorageCache | tryGetCache() const Try to get cached pointers for fast-path access. |
Protected Functions inherited from TensorStorageBase< MmapTensorStorage >
| Name | |
|---|---|
| ~TensorStorageBase() =default |
Detailed Description
class MmapTensorStorage;TensorData storage backed by a SharedMmapBlockCache.
Precondition: cache != nullptr
Presents a 2D tensor of shape [num_samples_per_channel, num_channels] over a block-cached memory-mapped interleaved binary file. Data is not contiguous in memory (split across cache blocks), so flatData() throws.
Public Functions Documentation
function MmapTensorStorage
inline explicit MmapTensorStorage(
std::shared_ptr< SharedMmapBlockCache const > cache
)function ~MmapTensorStorage
~MmapTensorStorage() =defaultfunction getValueAtImpl
inline float getValueAtImpl(
std::span< std::size_t const > indices
) constfunction flatDataImpl
inline std::span< float const > flatDataImpl() constfunction sliceAlongAxisImpl
inline std::vector< float > sliceAlongAxisImpl(
std::size_t axis,
std::size_t index
) constfunction getColumnImpl
inline std::vector< float > getColumnImpl(
std::size_t col
) constfunction shapeImpl
inline std::vector< std::size_t > shapeImpl() constfunction totalElementsImpl
inline std::size_t totalElementsImpl() constfunction isContiguousImpl
inline bool isContiguousImpl() constfunction getStorageTypeImpl
inline TensorStorageType getStorageTypeImpl() constfunction tryGetCacheImpl
inline TensorStorageCache tryGetCacheImpl() constfunction cache
inline std::shared_ptr< SharedMmapBlockCache const > const & cache() constUpdated on 2026-11-13 at 20:25:40 +0000