@@ -27,7 +27,7 @@ class SparseTensor_Op<string mnemonic, list<Trait> traits = []>
27
27
28
28
def SparseTensor_NewOp : SparseTensor_Op<"new", [NoSideEffect]>,
29
29
Arguments<(ins AnyType:$source)>,
30
- Results<(outs TensorOf<[AnyType]> :$result)> {
30
+ Results<(outs AnySparseTensor :$result)> {
31
31
string summary = "Materializes a new sparse tensor from given source";
32
32
string description = [{
33
33
Materializes a sparse tensor with contents taken from an opaque pointer
@@ -46,7 +46,6 @@ def SparseTensor_NewOp : SparseTensor_Op<"new", [NoSideEffect]>,
46
46
```
47
47
}];
48
48
let assemblyFormat = "$source attr-dict `:` type($source) `to` type($result)";
49
- let hasVerifier = 1;
50
49
}
51
50
52
51
def SparseTensor_ConvertOp : SparseTensor_Op<"convert",
@@ -92,7 +91,7 @@ def SparseTensor_ConvertOp : SparseTensor_Op<"convert",
92
91
}
93
92
94
93
def SparseTensor_ToPointersOp : SparseTensor_Op<"pointers", [NoSideEffect]>,
95
- Arguments<(ins AnyTensor :$tensor, Index:$dim)>,
94
+ Arguments<(ins AnySparseTensor :$tensor, Index:$dim)>,
96
95
Results<(outs AnyStridedMemRefOfRank<1>:$result)> {
97
96
let summary = "Extracts pointers array at given dimension from a tensor";
98
97
let description = [{
@@ -117,7 +116,7 @@ def SparseTensor_ToPointersOp : SparseTensor_Op<"pointers", [NoSideEffect]>,
117
116
}
118
117
119
118
def SparseTensor_ToIndicesOp : SparseTensor_Op<"indices", [NoSideEffect]>,
120
- Arguments<(ins AnyTensor :$tensor, Index:$dim)>,
119
+ Arguments<(ins AnySparseTensor :$tensor, Index:$dim)>,
121
120
Results<(outs AnyStridedMemRefOfRank<1>:$result)> {
122
121
let summary = "Extracts indices array at given dimension from a tensor";
123
122
let description = [{
@@ -142,7 +141,7 @@ def SparseTensor_ToIndicesOp : SparseTensor_Op<"indices", [NoSideEffect]>,
142
141
}
143
142
144
143
def SparseTensor_ToValuesOp : SparseTensor_Op<"values", [NoSideEffect]>,
145
- Arguments<(ins AnyTensor :$tensor)>,
144
+ Arguments<(ins AnySparseTensor :$tensor)>,
146
145
Results<(outs AnyStridedMemRefOfRank<1>:$result)> {
147
146
let summary = "Extracts numerical values array from a tensor";
148
147
let description = [{
@@ -173,7 +172,7 @@ def SparseTensor_ToValuesOp : SparseTensor_Op<"values", [NoSideEffect]>,
173
172
//===----------------------------------------------------------------------===//
174
173
175
174
def SparseTensor_LexInsertOp : SparseTensor_Op<"lex_insert", []>,
176
- Arguments<(ins AnyTensor :$tensor,
175
+ Arguments<(ins AnySparseTensor :$tensor,
177
176
StridedMemRefRankOf<[Index], [1]>:$indices,
178
177
AnyType:$value)> {
179
178
string summary = "Inserts a value into given sparse tensor in lexicographical index order";
@@ -196,11 +195,10 @@ def SparseTensor_LexInsertOp : SparseTensor_Op<"lex_insert", []>,
196
195
}];
197
196
let assemblyFormat = "$tensor `,` $indices `,` $value attr-dict `:`"
198
197
" type($tensor) `,` type($indices) `,` type($value)";
199
- let hasVerifier = 1;
200
198
}
201
199
202
200
def SparseTensor_ExpandOp : SparseTensor_Op<"expand", []>,
203
- Arguments<(ins AnyTensor :$tensor)>,
201
+ Arguments<(ins AnySparseTensor :$tensor)>,
204
202
Results<(outs AnyStridedMemRefOfRank<1>:$values,
205
203
StridedMemRefRankOf<[I1],[1]>:$filled,
206
204
StridedMemRefRankOf<[Index],[1]>:$added,
@@ -238,11 +236,10 @@ def SparseTensor_ExpandOp : SparseTensor_Op<"expand", []>,
238
236
}];
239
237
let assemblyFormat = "$tensor attr-dict `:` type($tensor) `to` type($values)"
240
238
" `,` type($filled) `,` type($added) `,` type($count)";
241
- let hasVerifier = 1;
242
239
}
243
240
244
241
def SparseTensor_CompressOp : SparseTensor_Op<"compress", []>,
245
- Arguments<(ins AnyTensor :$tensor,
242
+ Arguments<(ins AnySparseTensor :$tensor,
246
243
StridedMemRefRankOf<[Index],[1]>:$indices,
247
244
AnyStridedMemRefOfRank<1>:$values,
248
245
StridedMemRefRankOf<[I1],[1]>:$filled,
@@ -273,11 +270,10 @@ def SparseTensor_CompressOp : SparseTensor_Op<"compress", []>,
273
270
" $added `,` $count attr-dict `:` type($tensor) `,`"
274
271
" type($indices) `,` type($values) `,` type($filled) `,`"
275
272
" type($added) `,` type($count)";
276
- let hasVerifier = 1;
277
273
}
278
274
279
275
def SparseTensor_LoadOp : SparseTensor_Op<"load", [SameOperandsAndResultType]>,
280
- Arguments<(ins AnyTensor :$tensor, UnitAttr:$hasInserts)>,
276
+ Arguments<(ins AnySparseTensor :$tensor, UnitAttr:$hasInserts)>,
281
277
Results<(outs AnyTensor:$result)> {
282
278
let summary =
283
279
"Rematerializes tensor from underlying sparse storage format";
@@ -306,11 +302,10 @@ def SparseTensor_LoadOp : SparseTensor_Op<"load", [SameOperandsAndResultType]>,
306
302
```
307
303
}];
308
304
let assemblyFormat = "$tensor (`hasInserts` $hasInserts^)? attr-dict `:` type($tensor)";
309
- let hasVerifier = 1;
310
305
}
311
306
312
307
def SparseTensor_ReleaseOp : SparseTensor_Op<"release", []>,
313
- Arguments<(ins AnyTensor :$tensor)> {
308
+ Arguments<(ins AnySparseTensor :$tensor)> {
314
309
string summary = "Releases underlying sparse storage format of given tensor";
315
310
string description = [{
316
311
Releases the underlying sparse storage format for a tensor that
@@ -332,11 +327,10 @@ def SparseTensor_ReleaseOp : SparseTensor_Op<"release", []>,
332
327
```
333
328
}];
334
329
let assemblyFormat = "$tensor attr-dict `:` type($tensor)";
335
- let hasVerifier = 1;
336
330
}
337
331
338
332
def SparseTensor_OutOp : SparseTensor_Op<"out", []>,
339
- Arguments<(ins AnyType :$tensor, AnyType:$dest)> {
333
+ Arguments<(ins AnySparseTensor :$tensor, AnyType:$dest)> {
340
334
string summary = "Outputs a sparse tensor to the given destination";
341
335
string description = [{
342
336
Outputs the contents of a sparse tensor to the destination defined by an
@@ -353,7 +347,6 @@ def SparseTensor_OutOp : SparseTensor_Op<"out", []>,
353
347
```
354
348
}];
355
349
let assemblyFormat = "$tensor `,` $dest attr-dict `:` type($tensor) `,` type($dest)";
356
- let hasVerifier = 1;
357
350
}
358
351
359
352
//===----------------------------------------------------------------------===//
0 commit comments