Fix pyre type errors in Captum attr visualization helpers (#1874)#1874
Closed
Ayush-Warikoo wants to merge 1 commit into
Closed
Fix pyre type errors in Captum attr visualization helpers (#1874)#1874Ayush-Warikoo wants to merge 1 commit into
Ayush-Warikoo wants to merge 1 commit into
Conversation
Contributor
|
@Ayush-Warikoo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110250340. |
…ch#1874) Summary: Captum's GitHub Actions `Type checks / tests` job (pyre) fails on two pre-existing type errors that are unrelated to any particular PR but block every PR's CI. This fixes both. `captum/attr/_core/llm_attr.py:251` — pyre `Unsupported operand [58]`: `im.norm(val)` (a matplotlib `Normalize` call) returns a numpy value, so the chained comparison `0.2 < im.norm(val) < 0.8` is not statically supported. Wrap the single scalar in `float()` before comparing. Behavior is unchanged. `captum/attr/_utils/visualization.py:1097` — pyre `Incompatible parameter type [6]`: `plt.xlim` expects `Tuple[float, float]`, but was passed a list of numpy scalars. Pass a `(float(...), float(...))` tuple instead. matplotlib accepts this identically. Differential Revision: D110250340 Signed-off-by: Ayush Warikoo <ayushw@meta.com>
Ayush-Warikoo
force-pushed
the
export-D110250340
branch
from
July 1, 2026 10:57
e6b5958 to
26c666a
Compare
Ayush-Warikoo
added a commit
to Ayush-Warikoo/captum
that referenced
this pull request
Jul 1, 2026
…ch#1874) Summary: Captum's GitHub Actions `Type checks / tests` job (pyre) fails on two pre-existing type errors that are unrelated to any particular PR but block every PR's CI. This fixes both. `captum/attr/_core/llm_attr.py:251` — pyre `Unsupported operand [58]`: `im.norm(val)` (a matplotlib `Normalize` call) returns a numpy value, so the chained comparison `0.2 < im.norm(val) < 0.8` is not statically supported. Wrap the single scalar in `float()` before comparing. Behavior is unchanged. `captum/attr/_utils/visualization.py:1097` — pyre `Incompatible parameter type [6]`: `plt.xlim` expects `Tuple[float, float]`, but was passed a list of numpy scalars. Pass a `(float(...), float(...))` tuple instead. matplotlib accepts this identically. Differential Revision: D110250340
Contributor
|
This pull request has been merged in 0f05862. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Captum's GitHub Actions
Type checks / testsjob (pyre) fails on two pre-existing type errors that are unrelated to any particular PR but block every PR's CI. This fixes both.captum/attr/_core/llm_attr.py:251— pyreUnsupported operand [58]:im.norm(val)(a matplotlibNormalizecall) returns a numpy value, so the chained comparison0.2 < im.norm(val) < 0.8is not statically supported. Wrap the single scalar infloat()before comparing. Behavior is unchanged.captum/attr/_utils/visualization.py:1097— pyreIncompatible parameter type [6]:plt.xlimexpectsTuple[float, float], but was passed a list of numpy scalars. Pass a(float(...), float(...))tuple instead. matplotlib accepts this identically.Differential Revision: D110250340