Skip to content

[ARITH] Expose allow_override parameter in Python Analyzer.bind()#19417

Merged
tlopex merged 1 commit into
apache:mainfrom
fpedd:fpedd/arith/expose-bind-allow-override
Apr 24, 2026
Merged

[ARITH] Expose allow_override parameter in Python Analyzer.bind()#19417
tlopex merged 1 commit into
apache:mainfrom
fpedd:fpedd/arith/expose-bind-allow-override

Conversation

@fpedd

@fpedd fpedd commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

The C++ Analyzer::Bind() already supports allow_override, but the FFI bridge always used the default (false). This change threads the optional argument through the FFI layer and the Python wrapper so callers can rebind variables without triggering an error.

The C++ Analyzer::Bind() already supports allow_override, but the FFI
bridge always used the default (false). This change threads the optional
argument through the FFI layer and the Python wrapper so callers can
rebind variables without triggering an error.

@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 introduces an optional allow_override parameter to the Analyzer.bind method, allowing users to update existing variable bindings. The changes include updates to the Python API, the C++ FFI layer, and the addition of a unit test to verify the new functionality. A review comment suggests removing an unnecessary return statement in the Python implementation to align with the method's None return type hint.

Comment thread python/tvm/arith/analyzer.py

@tlopex tlopex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks!

@tlopex tlopex merged commit 2b87313 into apache:main Apr 24, 2026
6 checks passed
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