[Docs] Fix outdated code examples, typos, and missing API reference in documentation(2)#19344
[Docs] Fix outdated code examples, typos, and missing API reference in documentation(2)#19344tlopex wants to merge 1 commit intoapache:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request improves documentation by fixing variable names and typos, adding the TFLite frontend to the Relax API reference, and updating a tutorial to use a specific function name. Feedback suggests defining a constant for the function name in the tutorial to enhance maintainability and avoid potential inconsistencies.
| # device and returns the measured cost. Network overhead is excluded. | ||
|
|
||
| time_f = func.time_evaluator(func.entry_name, dev, number=10) | ||
| time_f = func.time_evaluator("add_one", dev, number=10) |
There was a problem hiding this comment.
While this change correctly fixes the issue, hardcoding the function name "add_one" as a string literal makes the code less maintainable. This name is also used on line 108 when creating the IRModule. It would be better to define a constant for the function name (e.g., ADD_ONE_FUNC_NAME = "add_one") and use it in both places. This would prevent potential inconsistencies if the function name is changed in the future.
This PR is a follow-up of #18965
lv0→lv,b→n) indocs/deep_dive/relax/learning.rstfunc.time_evaluator(func.entry_name, ...)tofunc.time_evaluator("add_one", ...)in
docs/how_to/tutorials/cross_compilation_and_rpc.py, sinceentry_nameis a classconstant
"main"but the compiled function is named"add_one"@tvfm.testing→@tvm.testingindocs/how_to/dev/pytest_target_parametrization.rsttvm.relax.frontend.tfliteautomodule entry todocs/reference/api/python/relax/frontend.rst