gemini-code-assist[bot] commented on code in PR #19966:
URL: https://github.com/apache/tvm/pull/19966#discussion_r3537989708
##########
python/tvm/relax/frontend/onnx/onnx_frontend.py:
##########
@@ -1936,13 +1936,23 @@ def _impl_v14(cls, bb, inputs, attr, params):
class Squeeze(OnnxOpConverter):
"""Converts an onnx Squeeze node into an equivalent Relax expression."""
+ @classmethod
+ def _impl_v1(cls, bb, inputs, attr, params):
+ # Prior to opset 13, axes is provided as an attribute rather than an
input.
+ axes = attr.get("axes", None)
+ axis = tuple(int(x) for x in axes) if axes is not None else None
+ return cls._squeeze(bb, inputs[0], axis)
Review Comment:

Since the `axes` attribute is already parsed as a `tuple` of integers (or
`None` if not present) by `_parse_attr`, the explicit conversion `tuple(int(x)
for x in axes)` is redundant. We can directly pass `axes` to `_squeeze`.
```suggestion
axes = attr.get("axes", None)
return cls._squeeze(bb, inputs[0], axes)
```
--
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]