Commit ae6df1b
[mlir][python] allow DenseIntElementsAttr for index type
Model the IndexType as size_t when converting to a python integer. This should
follow the definition of the IndexType as system-dependent.
This solves the following issue when for example an attribute is defined
as:
```
denseattr = dense<[1, 2, 3, 4]> : vector<4xindex>
```
which is a valid DenseElementsAttr. The change will fix an access issue
when reading the attribute in python. E.g.
```
DenseIntElementsAttr(op.attributes["denseattr"])
```
Co-authored-by: Tiago Trevisan Jost <[email protected]>
Co-authored-by: Matthias Gehre <[email protected]>1 parent efe4bfa commit ae6df1b
File tree
6 files changed
+25
-2
lines changed- mlir
- include/mlir-c
- lib
- Bindings/Python
- CAPI/IR
- test/python
- dialects
- ir
6 files changed
+25
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
| 559 | + | |
| 560 | + | |
559 | 561 | | |
560 | 562 | | |
561 | 563 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1172 | 1172 | | |
1173 | 1173 | | |
1174 | 1174 | | |
1175 | | - | |
1176 | | - | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
1177 | 1180 | | |
1178 | 1181 | | |
1179 | 1182 | | |
1180 | 1183 | | |
1181 | 1184 | | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1182 | 1188 | | |
1183 | 1189 | | |
1184 | 1190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
761 | 764 | | |
762 | 765 | | |
763 | 766 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
575 | 579 | | |
576 | 580 | | |
577 | 581 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
369 | 373 | | |
370 | 374 | | |
371 | 375 | | |
| |||
0 commit comments