Skip to content

Commit 40bad07

Browse files
address comment
1 parent fd1eb5f commit 40bad07

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,13 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding",
186186
- The explicit value for the sparse tensor. If explicitVal is set,
187187
then all the non-zero values in the tensor have the same explicit value.
188188
The default value Attribute() indicates that it is not set. This
189-
is useful for binary-valued tensors whose values could only
190-
be 0 or 1, as we can set the explicit value to be 1 instead of
191-
storing the values array.
189+
is useful for binary-valued sparse tensors whose values can either
190+
be an implicit value (0 by default) or an explicit value (such as 1).
191+
In this approach, we don't store explicit/implicit values, and metadata
192+
(such as position and coordinate arrays) alone fully defines the original tensor.
193+
This yields additional savings for the storage requirements,
194+
as well as for the computational time, since we skip operating on
195+
implicit values and can constant fold the explicit values where they are used.
192196

193197
- The implicit value for the sparse tensor. If implicitVal is set,
194198
then the "zero" value in the tensor is equal to the implicit value.

0 commit comments

Comments
 (0)