Commit ac7b5f5
authored
[Torch] Enable dtype inference for operations with list-type operands (#4406)
The type inference task consists of two subtasks: shape inference and
dtype inference. For operations such as `torch.aten.cat`, shape
inference works correctly, but dtype inference fails. This commit fixes
that issue.
Enable loop unrolling within `DtypeCalculateOp` regions to support dtype
inference for operations with list-type operands, such as
`torch.aten.cat`. This commit extends `FullyUnrollPrimLoop` pattern to
also unroll loops contained in `DtypeCalculateOp` regions, enabling the
simplification pass to promote dtype information through operations like
torch.aten.cat.1 parent 68e74f1 commit ac7b5f5
File tree
2 files changed
+36
-3
lines changed- lib/Dialect/Torch/Transforms
- test/Dialect/Torch
2 files changed
+36
-3
lines changedLines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | | - | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
218 | 249 | | |
219 | 250 | | |
220 | 251 | | |
| |||
0 commit comments