onnxruntime
onnxruntime copied to clipboard
[WIP] Squeeze node fails when axes is ""
- [x] Understand the issue: Squeeze node fails when axes is empty string ("") instead of omitted
- [x] Explore codebase and identify affected providers (CUDA, CPU, JS, WebGPU)
- [x] Create test cases to reproduce the issue
- [x] Fix CUDA provider (main issue)
- [x] Fix CPU provider
- [x] Fix JS provider
- [x] Fix WebGPU provider
- [x] Fix Unsqueeze operator with same issue
- [ ] Build and test the changes
- [ ] Ensure all existing tests still pass
Fixed the issue where Squeeze and Unsqueeze nodes fail when the optional axes input is provided as empty string (""). According to ONNX spec, this should be treated as "no axes provided".
Changes:
- Modified all Squeeze providers (CUDA, CPU, JS, WebGPU) to check if axes tensor is null or empty
- Applied same fix to Unsqueeze operators
- Added test cases to verify the fix works correctly
- When axes tensor is null or has size 0, fall back to using attribute axes or default behavior
Fixes #21661.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.