Commit 10f0d22
authored
Arm backend: Fix bug of inserting unnecessary casts for aten.where.self (#11816)
- In MatchWhereSelfDtypePass, target_dtype was initialized with fp32.
This works when at least one of the inputs is fp32. But when both inputs
are int32, the pass will incorrectly insert int32->fp32 casts. These
casts are unnecessary and may introduce operand dtype mismatch issues.
- Fix it by initializing target_dtype with input_dtype.
Signed-off-by: Yufeng Shi <[email protected]>1 parent bc605b8 commit 10f0d22
File tree
2 files changed
+8
-1
lines changed- backends/arm
- _passes
- test/ops
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
| |||
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| 143 | + | |
137 | 144 | | |
138 | 145 | | |
139 | 146 | | |
| |||
0 commit comments