Fix 2D detection bug (#21128)

### Description
Should compare two leading dims for 1.f

### Motivation and Context
Vulnerability scanner
This commit is contained in:
Dmitri Smirnov 2024-06-21 13:58:21 -07:00 committed by GitHub
parent ac21626725
commit b95982e588
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -230,7 +230,7 @@ Status Upsample<T>::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 "