javierdejesusda commented on code in PR #19573:
URL: https://github.com/apache/tvm/pull/19573#discussion_r3254044414


##########
python/tvm/relax/frontend/onnx/onnx_frontend.py:
##########
@@ -4231,7 +4231,7 @@ def _impl_v11(cls, bb, inputs, attr, params):
         k = inputs[1]
         if not isinstance(k, relax.Constant):
             raise ValueError("TopK k must be a constant")
-        k = int(k.data.numpy())
+        k = int(k.data.numpy().item())

Review Comment:
   Thanks. Applied `get_constant(inputs[1], params)` before the constant check 
so this matches the `Trilu`/`Reshape` pattern and also handles `k` arriving as 
a parameter under `keep_params_in_input=True`. The same `int(...numpy())` 
pattern in `SequenceErase`/`SequenceInsert`/`SequenceAt` looks like the same 
problem; leaving those for a separate follow-up to keep this PR scoped to 
#19571.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to