@@ -56,20 +56,20 @@ def SparseTensor_ConvertOp : SparseTensor_Op<"convert", [SameOperandsAndResultTy
56
56
Results<(outs AnyTensor:$dest)> {
57
57
string summary = "Converts between different tensor types";
58
58
string description = [{
59
- Converts one sparse or dense tensor type to another tensor type. The rank
60
- and dimensions of the source and destination types must match exactly,
61
- only the sparse encoding of these types may be different. The name `convert`
62
- was preferred over `cast`, since the operation may incur a non-trivial cost.
63
-
64
- When converting between two different sparse tensor types, only explicitly
65
- stored values are moved from one underlying sparse storage format to
66
- the other. When converting from an unannotated dense tensor type to a
67
- sparse tensor type, an explicit test for nonzero values is used. When
68
- converting to an unannotated dense tensor type, implicit zeroes in the
69
- sparse storage format are made explicit. Note that the conversions can have
70
- non-trivial costs associated with them, since they may involve elaborate
71
- data structure transformations. Also, conversions from sparse tensor types
72
- into dense tensor types may be infeasible in terms of storage requirements.
59
+ Converts one sparse or dense tensor type to another tensor type. The rank
60
+ and dimensions of the source and destination types must match exactly,
61
+ only the sparse encoding of these types may be different. The name `convert`
62
+ was preferred over `cast`, since the operation may incur a non-trivial cost.
63
+
64
+ When converting between two different sparse tensor types, only explicitly
65
+ stored values are moved from one underlying sparse storage format to
66
+ the other. When converting from an unannotated dense tensor type to a
67
+ sparse tensor type, an explicit test for nonzero values is used. When
68
+ converting to an unannotated dense tensor type, implicit zeroes in the
69
+ sparse storage format are made explicit. Note that the conversions can have
70
+ non-trivial costs associated with them, since they may involve elaborate
71
+ data structure transformations. Also, conversions from sparse tensor types
72
+ into dense tensor types may be infeasible in terms of storage requirements.
73
73
74
74
Examples:
75
75
@@ -88,15 +88,15 @@ def SparseTensor_ToPointersOp : SparseTensor_Op<"pointers", [NoSideEffect]>,
88
88
Results<(outs AnyStridedMemRefOfRank<1>:$result)> {
89
89
let summary = "Extract pointers array at given dimension from a tensor";
90
90
let description = [{
91
- Returns the pointers array of the sparse storage scheme at the
92
- given dimension for the given sparse tensor. This is similar to the
93
- `memref.buffer_cast` operation in the sense that it provides a bridge
94
- between a tensor world view and a bufferized world view. Unlike the
95
- `memref.buffer_cast` operation, however, this sparse operation actually
96
- lowers into a call into a support library to obtain access to the
97
- pointers array.
91
+ Returns the pointers array of the sparse storage scheme at the
92
+ given dimension for the given sparse tensor. This is similar to the
93
+ `memref.buffer_cast` operation in the sense that it provides a bridge
94
+ between a tensor world view and a bufferized world view. Unlike the
95
+ `memref.buffer_cast` operation, however, this sparse operation actually
96
+ lowers into a call into a support library to obtain access to the
97
+ pointers array.
98
98
99
- Example:
99
+ Example:
100
100
101
101
```mlir
102
102
%1 = sparse_tensor.pointers %0, %c1
@@ -112,15 +112,15 @@ def SparseTensor_ToIndicesOp : SparseTensor_Op<"indices", [NoSideEffect]>,
112
112
Results<(outs AnyStridedMemRefOfRank<1>:$result)> {
113
113
let summary = "Extract indices array at given dimension from a tensor";
114
114
let description = [{
115
- Returns the indices array of the sparse storage scheme at the
116
- given dimension for the given sparse tensor. This is similar to the
117
- `memref.buffer_cast` operation in the sense that it provides a bridge
118
- between a tensor world view and a bufferized world view. Unlike the
119
- `memref.buffer_cast` operation, however, this sparse operation actually
120
- lowers into a call into a support library to obtain access to the
121
- indices array.
115
+ Returns the indices array of the sparse storage scheme at the
116
+ given dimension for the given sparse tensor. This is similar to the
117
+ `memref.buffer_cast` operation in the sense that it provides a bridge
118
+ between a tensor world view and a bufferized world view. Unlike the
119
+ `memref.buffer_cast` operation, however, this sparse operation actually
120
+ lowers into a call into a support library to obtain access to the
121
+ indices array.
122
122
123
- Example:
123
+ Example:
124
124
125
125
```mlir
126
126
%1 = sparse_tensor.indices %0, %c1
@@ -136,15 +136,15 @@ def SparseTensor_ToValuesOp : SparseTensor_Op<"values", [NoSideEffect]>,
136
136
Results<(outs AnyStridedMemRefOfRank<1>:$result)> {
137
137
let summary = "Extract numerical values array from a tensor";
138
138
let description = [{
139
- Returns the values array of the sparse storage scheme for the given
140
- sparse tensor, independent of the actual dimension. This is similar to
141
- the `memref.buffer_cast` operation in the sense that it provides a bridge
142
- between a tensor world view and a bufferized world view. Unlike the
143
- `memref.buffer_cast` operation, however, this sparse operation actually
144
- lowers into a call into a support library to obtain access to the
145
- values array.
146
-
147
- Example:
139
+ Returns the values array of the sparse storage scheme for the given
140
+ sparse tensor, independent of the actual dimension. This is similar to
141
+ the `memref.buffer_cast` operation in the sense that it provides a bridge
142
+ between a tensor world view and a bufferized world view. Unlike the
143
+ `memref.buffer_cast` operation, however, this sparse operation actually
144
+ lowers into a call into a support library to obtain access to the
145
+ values array.
146
+
147
+ Example:
148
148
149
149
```mlir
150
150
%1 = sparse_tensor.values %0 : tensor<64x64xf64, #CSR> to memref<?xf64>
0 commit comments