[Docs] Fix outdated code examples, typos, and missing API reference in documentation(2)#19344
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.
…n documentation(2) (apache#19344) This PR is a follow-up of apache#18965 - Fix incorrect variable names in Relax dataflow code example (`lv0` → `lv`, `b` → `n`) in `docs/deep_dive/relax/learning.rst` - Fix `func.time_evaluator(func.entry_name, ...)` to `func.time_evaluator("add_one", ...)` in `docs/how_to/tutorials/cross_compilation_and_rpc.py`, since `entry_name` is a class constant `"main"` but the compiled function is named `"add_one"` - Fix typo `tvfm.testing` → `tvm.testing` in `docs/how_to/dev/pytest_target_parametrization.rst` - Add missing `tvm.relax.frontend.tflite` automodule entry to `docs/reference/api/python/relax/frontend.rst`
…ss documentation (apache#19351) This PR is a follow-up PR of apache#19344 , continuing cleaning up outdated items in docs
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