Xnnpack execution provider Resize::IsOnnxNodeSupported causes crash for models where Resize layer scales tensor is an empty tensor #23886
Labels
ep:Xnnpack
issues related to XNNPACK EP
platform:mobile
issues related to ONNX Runtime mobile; typically submitted using template
Describe the issue
onnxruntime/core/providers/xnnpack/tensor/resize.cc:69 (const auto scales = scale_val.DataAsSpan();)

results in crash if scales tensor is an empty tensor.
This is the case from some onnx models where both scales and sizes tensor is provided. In this case scales is an empty tensor and size tensor has data. See attached netron visualization clip from the model.
Applying a condition (e.g. "if(scale_val.size() > 1) {" ) to check size of scales resolves this issue. I suggest this fix is introduced.
To reproduce
I cannot not share proprietary model.
Urgency
No response
Platform
Android
OS Version
Any recent version
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
1ffe793
ONNX Runtime API
C++
Architecture
ARM64
Execution Provider
Other / Unknown
Execution Provider Library Version
xnnpack
The text was updated successfully, but these errors were encountered: