Skip to content

Commit b95982e

Browse files
authored
Fix 2D detection bug (#21128)
### Description Should compare two leading dims for 1.f ### Motivation and Context Vulnerability scanner
1 parent ac21626 commit b95982e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

onnxruntime/core/providers/cuda/tensor/upsample.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Status Upsample<T>::BaseCompute(OpKernelContext* context,
230230
}
231231

232232
const bool is_2D = X_dims.size() == 2;
233-
const bool is_nchw = is_2D ? true : (scales[1] == 1.0f && scales[1] == 1.0f);
233+
const bool is_nchw = is_2D ? true : (scales[0] == 1.0f && scales[1] == 1.0f);
234234

235235
ORT_RETURN_IF_NOT(is_nchw,
236236
"Resize 'Cubic' mode only supports NCWH layout "

0 commit comments

Comments
 (0)