gemini-code-assist[bot] commented on code in PR #19557:
URL: https://github.com/apache/tvm/pull/19557#discussion_r3232537628
##########
tests/python/relax/test_frontend_onnx.py:
##########
@@ -4924,7 +4924,7 @@ def
test_nms_max_output_boxes_per_class_zero(with_explicit_max: bool):
check_correctness(model, inputs=inputs, opset=11)
tvm_out = run_in_tvm(model, inputs=inputs, opset=11)
- tvm_selected = tvm_out[0].numpy() if isinstance(tvm_out, (list, tuple))
else tvm_out.numpy()
+ tvm_selected = tvm_out[0].numpy() if isinstance(tvm_out, list | tuple)
else tvm_out.numpy()
Review Comment:

The use of the pipe operator (`|`) for type unions in `isinstance` is a
Python 3.10+ feature (PEP 604). TVM currently maintains compatibility with
older Python versions (e.g., 3.8 and 3.9), and this change will cause a
`TypeError` in those environments. Please revert to the compatible tuple
syntax: `isinstance(tvm_out, (list, tuple))`. Additionally, this change appears
to be an unrelated drive-by modification.
```suggestion
tvm_selected = tvm_out[0].numpy() if isinstance(tvm_out, (list, tuple))
else tvm_out.numpy()
```
--
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]