Commit 4330ac2
committed
Fix torch.split fails in to_edge with alias annotations
Fixes #11723
_remove_invalid_ops_for_not_decompose relied on torchgen's
aliased_return_names() to detect ops with aliased returns, but it
returns [None] for ops returning lists of aliased tensors (e.g.,
split.Tensor returns Tensor(a)[]). This let split.Tensor through
into the EDGE_DO_NOT_DECOMP namespace where functionalization failed.
Add a fallback check using op._schema.returns directly, which
correctly reports alias_info on list return types. This also
fixes the same latent issue for chunk and tensor_split.
Signed-off-by: Lidang-Jiang <lidangjiang@gmail.com>1 parent 6020c29 commit 4330ac2
2 files changed
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1122 | 1122 | | |
1123 | 1123 | | |
1124 | 1124 | | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
1125 | 1135 | | |
1126 | 1136 | | |
1127 | 1137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
943 | 979 | | |
944 | 980 | | |
945 | 981 | | |
| |||
0 commit comments