[Bug] [FRONTEND][ONNX] failed to import TopK operator when K is a constant tensor: ValueError: TopK k must be a constant #17856
Labels
needs-triage
PRs or issues that need to be investigated by maintainers to find the right assignees to address it
type: bug
Expected behavior
The onnx frontend should import the model correctly.
Actual behavior
When importing the following onnx model, tvm crashes as follows:
The attribute K of TopK should be a constant. In this model, K is a constant tensor, which meets the constraint of TopK. Thus, this may be a bug of the onnx frontend in TVM.
Environment
OS: Ubuntu 20.04
TVM: 0.21.dev0(c00f52a)
Steps to reproduce
This bug can be reproduced by the following code with the model in the attachment. As shown in the code, the model can be executed by onnxruntime.
testcase.zip
Triage
cc @KJlaccHoeUM9l
The text was updated successfully, but these errors were encountered: