Skip to content

fix: correct additional typos identified in review#18745

Closed
thecaptain789 wants to merge 1 commit into
apache:mainfrom
thecaptain789:fix-typos-from-pr-18739-review
Closed

fix: correct additional typos identified in review#18745
thecaptain789 wants to merge 1 commit into
apache:mainfrom
thecaptain789:fix-typos-from-pr-18739-review

Conversation

@thecaptain789

Copy link
Copy Markdown
Contributor

Summary

This PR fixes additional typos identified by Gemini Code Assist during the review of PR #18739.

Changes

  1. python/tvm/ir/base.py (line 191): assert_strucural_equalassert_structural_equal (in docstring "See Also" section)

  2. python/tvm/ir/base.py (line 292): structrual_equalstructural_equal (in docstring "See Also" section)

  3. include/tvm/node/structural_hash.h (line 20): Fixed \\file comment path from structural_equal.h to structural_hash.h (matching actual filename)

  4. tests/python/tir-base/test_tir_structural_equal_hash.py: Changed sequal to struct_equal in error messages and get_sequal_mismatch to get_struct_equal_mismatch for consistency with the variable names used in the code (struct_equal0, struct_equal1)

Context

These typos were identified by the AI code reviewer on our existing PR and are follow-up fixes to keep the codebase consistent.


Typo fix PR - automated detection via AI code review

Fix typos in docstrings and comments identified by Gemini Code Assist
during PR apache#18739 review:

- python/tvm/ir/base.py: 'assert_strucural_equal' → 'assert_structural_equal'
- python/tvm/ir/base.py: 'structrual_equal' → 'structural_equal'
- include/tvm/node/structural_hash.h: fix file path in comment
- tests/python/tir-base/test_tir_structural_equal_hash.py: 'sequal' → 'struct_equal' for consistency with variable names
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @thecaptain789, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses several minor textual inconsistencies and typos across the codebase, primarily within docstrings and test files. These changes, identified by an AI code reviewer, aim to improve code clarity and maintain naming conventions, ensuring a more consistent and readable codebase.

Highlights

  • Docstring Typo Correction: Corrected "assert_strucural_equal" to "assert_structural_equal" and "structrual_equal" to "structural_equal" in python/tvm/ir/base.py docstrings.
  • Header File Path Fix: Updated the \file comment path from structural_equal.h to structural_hash.h in include/tvm/node/structural_hash.h to match the actual filename.
  • Test File Consistency: Renamed instances of "sequal" to "struct_equal" in error messages and "get_sequal_mismatch" to "get_struct_equal_mismatch" within tests/python/tir-base/test_tir_structural_equal_hash.py for improved consistency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • include/tvm/node/structural_hash.h
    • Corrected the \file comment path to match the actual filename structural_hash.h.
  • python/tvm/ir/base.py
    • Fixed a typo from assert_strucural_equal to assert_structural_equal in a docstring.
    • Corrected a typo from structrual_equal to structural_equal in a docstring.
  • tests/python/tir-base/test_tir_structural_equal_hash.py
    • Updated sequal to struct_equal in error messages for consistency.
    • Renamed get_sequal_mismatch to get_struct_equal_mismatch to align with variable names.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

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.

Code Review

This pull request addresses several typos found in comments, docstrings, and test code, which improves the overall quality and consistency of the codebase. The fixes are correct and well-contained. I've added a couple of minor suggestions in the test file to use f-strings for formatting error messages, which would improve readability and align with modern Python practices. Otherwise, the changes look good.

Comment on lines +34 to 36
"Non-commutative {} vs {}, struct_equal0={}, struct_equal1={}".format(
x, y, struct_equal0, struct_equal1
)

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

For improved readability and conciseness, consider using an f-string for this error message. F-strings are generally preferred over .format() in modern Python.

            f"Non-commutative {x} vs {y}, struct_equal0={struct_equal0}, struct_equal1={struct_equal1}"

Comment on lines +43 to 45
"Inconsistent {} vs {}, struct_equal={}, xhash={}, yhash={}".format(
x, y, struct_equal0, xhash, yhash
)

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

Similar to the previous suggestion, using an f-string here would make the error message more readable and is consistent with modern Python style.

            f"Inconsistent {x} vs {y}, struct_equal={struct_equal0}, xhash={xhash}, yhash={yhash}"

@tqchen tqchen closed this Feb 10, 2026
@tqchen

tqchen commented Feb 10, 2026

Copy link
Copy Markdown
Member

please make the change in the original pr

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.

2 participants