Commit 0c7adc2
authored
[Relax] Add FRelaxInferLayout for scatter_elements operator (#18638)
## Why
The scatter_elements operator was missing FRelaxInferLayout support,
which prevented proper layout transformation when used with operators
like conv2d that require layout conversion.
## How
- Implement InferLayoutScatterElements function that handles layout
inference for scatter_elements
- Transform axis attribute according to the inferred layout using
FindAxis
- Handle sub-indexed layout fallback to initial layout
- Add test case for conv2d + scatter_elements layout conversion1 parent a95b90c commit 0c7adc2
File tree
3 files changed
+92
-8
lines changed- src/relax/op/tensor
- tests/python
- contrib/test_msc
- relax
3 files changed
+92
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2613 | 2613 | | |
2614 | 2614 | | |
2615 | 2615 | | |
2616 | | - | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
2617 | 2645 | | |
2618 | 2646 | | |
2619 | 2647 | | |
2620 | 2648 | | |
2621 | 2649 | | |
2622 | 2650 | | |
2623 | 2651 | | |
| 2652 | + | |
2624 | 2653 | | |
2625 | 2654 | | |
2626 | 2655 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2443 | 2443 | | |
2444 | 2444 | | |
2445 | 2445 | | |
2446 | | - | |
2447 | | - | |
| 2446 | + | |
| 2447 | + | |
2448 | 2448 | | |
2449 | 2449 | | |
2450 | | - | |
| 2450 | + | |
2451 | 2451 | | |
2452 | 2452 | | |
2453 | 2453 | | |
2454 | 2454 | | |
2455 | 2455 | | |
2456 | | - | |
2457 | | - | |
2458 | | - | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
2459 | 2459 | | |
2460 | 2460 | | |
2461 | | - | |
| 2461 | + | |
2462 | 2462 | | |
2463 | 2463 | | |
2464 | 2464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5327 | 5327 | | |
5328 | 5328 | | |
5329 | 5329 | | |
| 5330 | + | |
| 5331 | + | |
| 5332 | + | |
| 5333 | + | |
| 5334 | + | |
| 5335 | + | |
| 5336 | + | |
| 5337 | + | |
| 5338 | + | |
| 5339 | + | |
| 5340 | + | |
| 5341 | + | |
| 5342 | + | |
| 5343 | + | |
| 5344 | + | |
| 5345 | + | |
| 5346 | + | |
| 5347 | + | |
| 5348 | + | |
| 5349 | + | |
| 5350 | + | |
| 5351 | + | |
| 5352 | + | |
| 5353 | + | |
| 5354 | + | |
| 5355 | + | |
| 5356 | + | |
| 5357 | + | |
| 5358 | + | |
| 5359 | + | |
| 5360 | + | |
| 5361 | + | |
| 5362 | + | |
| 5363 | + | |
| 5364 | + | |
| 5365 | + | |
| 5366 | + | |
| 5367 | + | |
| 5368 | + | |
| 5369 | + | |
| 5370 | + | |
| 5371 | + | |
| 5372 | + | |
| 5373 | + | |
| 5374 | + | |
| 5375 | + | |
| 5376 | + | |
| 5377 | + | |
| 5378 | + | |
| 5379 | + | |
| 5380 | + | |
| 5381 | + | |
| 5382 | + | |
| 5383 | + | |
| 5384 | + | |
5330 | 5385 | | |
5331 | 5386 | | |
0 commit comments