Skip to content

[Docs] Fix outdated code examples, typos, and missing API reference in documentation(2)#19344

Open
tlopex wants to merge 1 commit intoapache:mainfrom
tlopex:doc141
Open

[Docs] Fix outdated code examples, typos, and missing API reference in documentation(2)#19344
tlopex wants to merge 1 commit intoapache:mainfrom
tlopex:doc141

Conversation

@tlopex
Copy link
Copy Markdown
Member

@tlopex tlopex commented Apr 4, 2026

This PR is a follow-up of #18965

  • Fix incorrect variable names in Relax dataflow code example (lv0lv, bn) 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

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant