gemini-code-assist[bot] commented on code in PR #18544:
URL: https://github.com/apache/tvm/pull/18544#discussion_r2588322458
##########
python/tvm/relax/frontend/torch/exported_program_translator.py:
##########
@@ -1604,9 +1603,16 @@ def from_exported_program(
keep_params_as_input: bool,
unwrap_unit_return_tuple: bool,
no_bind_return_tuple: bool,
+ custom_convert_map: Dict[str, Callable[[fx.Node, BaseFXGraphImporter],
relax.Var]],
Review Comment:

The `from_exported_program` function, which calls this method, has a default
value of `None` for `custom_convert_map`. To ensure type consistency, this
parameter's type hint should be `Optional[Dict[...]]` to reflect that it can be
`None`.
```suggestion
custom_convert_map: Optional[Dict[str, Callable[[fx.Node,
BaseFXGraphImporter], relax.Var]]],
```
##########
python/tvm/relax/frontend/torch/exported_program_translator.py:
##########
@@ -1711,6 +1720,7 @@ def from_exported_program(
keep_params_as_input: bool = False,
unwrap_unit_return_tuple: bool = False,
no_bind_return_tuple: bool = False,
+ custom_convert_map: Dict[str, Callable[[fx.Node, BaseFXGraphImporter],
relax.Var]] = None,
Review Comment:

For better type hinting and to follow standard Python typing practices,
`Optional` should be used here to indicate that `custom_convert_map` can be
`None`.
```suggestion
custom_convert_map: Optional[Dict[str, Callable[[fx.Node,
BaseFXGraphImporter], relax.Var]]] = None,
```
--
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]