From c3265aabfc3f8529a64e7b21429f29ce90d173df Mon Sep 17 00:00:00 2001 From: Alejandro Perez Munoz Date: Fri, 8 Nov 2024 12:26:46 -0800 Subject: [PATCH] Disable pyre errors for _utils/common. (#1434) Summary: Pull Request resolved: https://github.com/pytorch/captum/pull/1434 A Pyre upgrade added a few more typing failures. Reviewed By: jjuncho Differential Revision: D65605487 fbshipit-source-id: 1b1559675fefe3e5a0e73539108a6cdb225f2e43 --- captum/_utils/common.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/captum/_utils/common.py b/captum/_utils/common.py index 6459cd8aa..b4bee7937 100644 --- a/captum/_utils/common.py +++ b/captum/_utils/common.py @@ -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: @@ -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 (