Skip to main content

Module csf_tensor

Module csf_tensor 

Source
Expand description

Compressed Sparse Fiber (CSF) format for sparse tensors

CSF is a hierarchical compressed format for sparse tensors, analogous to CSR/CSC for matrices but generalized to arbitrary dimensions. Each level in the hierarchy compresses one tensor mode.

For an N-dimensional tensor, CSF uses N levels:

  • Level 0: the coarsest (outermost) mode
  • Level N-1: the finest (innermost) mode, where values are stored

Each level l has:

  • fptr[l]: fiber pointers (like indptr in CSR)
  • fids[l]: fiber indices (like indices in CSR)

The values are associated with the leaf-level fibers.

This provides excellent compression for tensors with hierarchical sparsity patterns (e.g., most real-world tensors).

Structsยง

CsfTensor
Compressed Sparse Fiber (CSF) tensor format