tracel-ai/burn

Support Sparse Tensors

Aperta

#846 aperta il 4 ott 2023

 (12 commenti) (5 reazioni) (0 assegnatari)Rust (964 fork)auto 404
featurehelp wanted

Metriche repository

Star
 (15.550 stelle)
Metriche merge PR
 (Merge medio 2g 22h) (129 PR mergiate in 30 g)

Descrizione

Feature description

A tensor representation that only stores data for positions where the value non-zero. Operations on sparse tensors could then be optimized based on the fact that most of the tensor is empty and only a few points need to be computed.

Feature motivation

Sometimes I (and others) deal with cases where tensors are always largely empty (often less than 1% full). In such cases, it would much more efficient (memory-wise and computationally) to only store data for indexes that are used. This is especially important for scenarios when the tensor would be very large if it were represented in a dense representation.

(Optional) Suggest a Solution

I don't have a concrete idea how this might be implemented, I imagine existing libraries (such as sprs in rust, or in other ecosystems) can serve as inspiration.

Guida contributor