Skip to content

[Fix][Relax][ONNX] Read the K input for opset 10 TopK - #21077

Open
tandede wants to merge 1 commit into
apache:mainfrom
tandede:fix/onnx-topk-opset10
Open

tandede wants to merge 1 commit into
apache:mainfrom
tandede:fix/onnx-topk-opset10

Conversation

@tandede

@tandede tandede commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

ONNX moved K from an attribute to a tensor input in opset 10. Without a version 10 converter, Relax fell back to the attribute-based converter and returned just one value and index even when the model requested two. Reuse the existing constant-input converter for version 10.

The regression test exercises opsets 1, 10 and 11 on the same input and compares both outputs with ONNX Runtime. All nine TopK tests and the pre-commit checks for the changed files passed locally.

Fixes #21072.

OpenAI Codex helped prepare and test this change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [ONNX] TopK opset 10 ignores K input and returns one element

1 participant