From b95982e588e2d433958aa9aa82557b714ec4e3de Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Fri, 21 Jun 2024 13:58:21 -0700 Subject: [PATCH] Fix 2D detection bug (#21128) ### Description Should compare two leading dims for 1.f ### Motivation and Context Vulnerability scanner --- onnxruntime/core/providers/cuda/tensor/upsample.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/cuda/tensor/upsample.cc b/onnxruntime/core/providers/cuda/tensor/upsample.cc index 17533eb3d9..cbf745d3c7 100644 --- a/onnxruntime/core/providers/cuda/tensor/upsample.cc +++ b/onnxruntime/core/providers/cuda/tensor/upsample.cc @@ -230,7 +230,7 @@ Status Upsample::BaseCompute(OpKernelContext* context, } const bool is_2D = X_dims.size() == 2; - const bool is_nchw = is_2D ? true : (scales[1] == 1.0f && scales[1] == 1.0f); + const bool is_nchw = is_2D ? true : (scales[0] == 1.0f && scales[1] == 1.0f); ORT_RETURN_IF_NOT(is_nchw, "Resize 'Cubic' mode only supports NCWH layout "