Mode Formats

class pytaco.mode_format

Defines the storage format for a given dimension (mode) of a tensor.

Dimensions (modes) can either be dense (all elements are stored) or compressed as a sparse representation where only the non-zeros of the dimension are stored.


PyTaco currently exports the following mode formats:

compressed or Compressed - Only store non-zeros. eg. The second mode (dimension) in CSR

dense or Dense - Store all elements in dimension. eg. The first mode (dimension) in CSR

Explicit 0s resulting from computation are always stored even though a mode is marked as compressed. This is to avoid checking every result from a computation which would slow down taco.


>>> import pytaco as pt
>>> pt.dense
>>> pt.compressed

Returns a string identifying the mode format.