Skip to content

Commit a08f04b

Browse files
Vivek Miglanifacebook-github-bot
authored andcommitted
Fix typing pyre fix me issues (#1480)
Summary: Fix typing fixme issues and switch slice to pyre-ignore, since this is related to earlier Python version limitation Differential Revision: D67726226
1 parent 5594316 commit a08f04b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

captum/_utils/typing.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
TensorOrTupleOfTensorsGeneric = TypeVar(
2222
"TensorOrTupleOfTensorsGeneric", Tensor, Tuple[Tensor, ...]
2323
)
24-
# pyre-fixme[24]: Generic type `tuple` expects at least 1 type parameter.
25-
TupleOrTensorOrBoolGeneric = TypeVar("TupleOrTensorOrBoolGeneric", Tuple, Tensor, bool)
24+
TupleOrTensorOrBoolGeneric = TypeVar(
25+
"TupleOrTensorOrBoolGeneric", Tuple[Tensor, ...], Tensor, bool
26+
)
2627
ModuleOrModuleList = TypeVar("ModuleOrModuleList", Module, List[Module])
2728
TargetType = Union[None, int, Tuple[int, ...], Tensor, List[Tuple[int, ...]], List[int]]
2829
BaselineTupleType = Union[None, Tuple[Union[Tensor, int, float], ...]]
@@ -46,7 +47,7 @@
4647
# falling back to slice type.
4748
SliceIntType = slice[int, int, int]
4849
except TypeError:
49-
# pyre-fixme[24]: Generic type `slice` expects 3 type parameters.
50+
# pyre-ignore[24]: Generic type `slice` expects 3 type parameters.
5051
SliceIntType = slice # type: ignore
5152

5253
# Necessary for Python >=3.7 and <3.9!

0 commit comments

Comments
 (0)