MLIR
20.0.0git
|
An element of a sparse tensor in coordinate-scheme representation (i.e., a pair of coordinates and value). More...
#include "mlir/ExecutionEngine/SparseTensor/COO.h"
Public Member Functions | |
Element (const uint64_t *coords, V val) | |
Public Attributes | |
const uint64_t * | coords |
V | value |
An element of a sparse tensor in coordinate-scheme representation (i.e., a pair of coordinates and value).
For example, a rank-1 vector element would look like ({i}, a[i]) and a rank-5 tensor element would look like ({i,j,k,l,m}, a[i,j,k,l,m])
The coordinates are represented as a (non-owning) pointer into a shared pool of coordinates, rather than being stored directly in this object. This significantly improves performance because it reduces the per-element memory footprint and centralizes the memory management for coordinates. The only downside is that the coordinates themselves cannot be retrieved without knowing the rank of the tensor to which this element belongs (and that rank is not stored in this object).
|
inline |
const uint64_t* mlir::sparse_tensor::Element< V >::coords |
Definition at line 42 of file COO.h.
Referenced by mlir::sparse_tensor::ElementLT< V >::operator()().
V mlir::sparse_tensor::Element< V >::value |