gemini-code-assist[bot] commented on code in PR #19964:
URL: https://github.com/apache/tvm/pull/19964#discussion_r3533951227
##########
python/tvm/relax/frontend/torch/fx_translator.py:
##########
@@ -1093,6 +1093,13 @@ def from_fx(
# Find all the missing function types
self._check_unsupported_func_type(graph.nodes)
+ # Symbolic shape vars from input_info, keyed by name, so that symbolic
+ # scalar inputs (e.g. a SymInt batch size lifted by dynamo) can be
+ # bound to the same vars used in the input tensors' shapes.
+ sym_vars = {
+ v.name: v for shape, _ in input_info for v in shape if
isinstance(v, tvm.tirx.Var)
+ }
Review Comment:

Relying on transitive imports for submodules (like `tvm.tirx`) can be
fragile and may lead to `AttributeError` if the import structure of other
modules changes. It is safer and more robust to explicitly import `tirx`
locally within the function.
```python
from tvm import tirx
sym_vars = {
v.name: v for shape, _ in input_info for v in shape if
isinstance(v, tirx.Var)
}
```
--
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]