Skip to content

Restructuring the Tensor Interface with Inserter and Iterator extraction

Simon Praetorius requested to merge feature/sparse-general-tensor into main

Summary

What have DenseTensor and SparseTensor interfaces in common? Both have an index-access method, provide access to their extents. But also both have actually a storage container for values and an index-mapping. In the sparse case we map only those indices that exist in the storage to a flat index. In this MR, the idea of an index-mapping (layout) and a separate storage class (container) is implemented for the SparseTensor base class. With this, the CRS and COO Tensors are just two different index-mapping strategies and others can be implemented analogously. When extracting the index-mapping, also the iteration over the non-zero entries must be adapted. With the MR, the iterators over non-zeros but also over the major axis is extracted into iterator classes.

Edited by Simon Praetorius

Merge request reports

Loading