Commit 493bb33
authored
[TorchToLinalg] simplify non-broadcast unit dim indexing maps in elementise generics (#4107)
This change is made to reduce the pattern-matching load for fusing
elementwise generic ops with non-broadcasting unit dims.
For example, adding tensors with shapes `[6,1]` and `[1]`, the output
shape will be `[6,1]`. Before this change, the indexing maps were
inconsistent between the inputs and outputs for the unit-dim (constant 0
for inputs, and a dim expression for the output).
---------
Signed-off-by: zjgarvey <[email protected]>1 parent 692b2c0 commit 493bb33
File tree
2 files changed
+43
-9
lines changed- lib/Conversion/TorchToLinalg
- test/Conversion/TorchToLinalg
2 files changed
+43
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
258 | 279 | | |
259 | 280 | | |
| 281 | + | |
260 | 282 | | |
261 | 283 | | |
262 | 284 | | |
263 | 285 | | |
264 | 286 | | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | 287 | | |
274 | 288 | | |
275 | 289 | | |
276 | 290 | | |
277 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
278 | 299 | | |
279 | 300 | | |
280 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
0 commit comments