Skip to content

Commit

Permalink
Disable pyre errors for _utils/common. (#1434)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #1434

A Pyre upgrade added a few more typing failures.

Reviewed By: jjuncho

Differential Revision: D65605487

fbshipit-source-id: 1b1559675fefe3e5a0e73539108a6cdb225f2e43
  • Loading branch information
cyrjano authored and facebook-github-bot committed Nov 8, 2024
1 parent d241b2a commit c3265aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion captum/_utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ def _select_targets(output: Tensor, target: TargetType) -> Tensor:
raise AssertionError(f"Target type {type(target)} is not valid.")


# pyre-fixme[24]: Generic type `slice` expects 3 type parameters.
def _contains_slice(target: Union[int, Tuple[Union[int, slice], ...]]) -> bool:
if isinstance(target, tuple):
for index in target:
Expand All @@ -690,7 +691,9 @@ def _contains_slice(target: Union[int, Tuple[Union[int, slice], ...]]) -> bool:


def _verify_select_column(
output: Tensor, target: Union[int, Tuple[Union[int, slice], ...]]
# pyre-fixme[24]: Generic type `slice` expects 3 type parameters.
output: Tensor,
target: Union[int, Tuple[Union[int, slice], ...]],
) -> Tensor:
target = (target,) if isinstance(target, int) else target
assert (
Expand Down

0 comments on commit c3265aa

Please sign in to comment.