Commit c70b342
committed
Fix WebGPU Conv auto_pad=SAME_UPPER padding calculation
The WebGPU Conv and ConvTranspose operators were producing incorrect
results when using auto_pad=SAME_UPPER with strides > 1.
Root cause: The head padding values were being unnecessarily recalculated
after InferPadsAndOutputShape() had already computed the correct values.
The recalculation formula could produce incorrect results.
Fix: Simply use pads[0] and pads[1] directly, which already contain the
correct head padding values computed upstream. This matches the behavior
of the TypeScript implementation.
Fixes #267341 parent 260a48c commit c70b342
File tree
2 files changed
+8
-8
lines changed- onnxruntime/core/providers/webgpu/nn
2 files changed
+8
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 90 | + | |
| 91 | + | |
93 | 92 | | |
94 | 93 | | |
95 | | - | |
| 94 | + | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| |||
0 commit comments