Skip to content

Commit ca1b32d

Browse files
xhcaofs-eire
andauthored
[webgpu] Fix ROUND_PREFER_CEIL issue of Resize operator (microsoft#24229)
### Description <!-- Describe your changes. --> ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Co-authored-by: Yulong Wang <[email protected]>
1 parent 350d140 commit ca1b32d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

onnxruntime/core/providers/webgpu/tensor/resize_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void CalcNearestPixel(std::ostream& os, ResizeNearestMode mode) {
122122
body = "select(i32(round(x_original)), i32(floor(x_original)), x_original == f32(i32(x_original)) + 0.5)";
123123
break;
124124
case ResizeNearestMode::ROUND_PREFER_CEIL:
125-
body = "i32(round(x_original))";
125+
body = "select(i32(round(x_original)), i32(ceil(x_original)), x_original == f32(i32(x_original)) + 0.5)";
126126
break;
127127
case ResizeNearestMode::FLOOR:
128128
body = "i32(floor(x_original))";

0 commit comments

Comments
 (0)