Skip to content

Commit 608e284

Browse files
Vivek Miglanifacebook-github-bot
authored andcommitted
Fix Guided Backprop pyre fixme issues (#1605)
Summary: Pull Request resolved: #1605 Fixing unresolved pyre fixme issues in corresponding file Reviewed By: styusuf Differential Revision: D76737312 fbshipit-source-id: 9f1bd322315d423eeee3cb622373fec2bbbd5e5f
1 parent b804b08 commit 608e284

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

captum/attr/_core/guided_backprop_deconvnet.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# pyre-strict
44
import warnings
5-
from typing import Callable, List, Optional, Tuple, Union
5+
from typing import cast, List, Optional, Tuple, Union
66

77
import torch
88
import torch.nn.functional as F
@@ -78,12 +78,11 @@ def attribute(
7878
self._remove_hooks()
7979

8080
undo_gradient_requirements(inputs_tuple, gradient_mask)
81-
# pyre-fixme[7]: Expected `TensorOrTupleOfTensorsGeneric` but got
82-
# `Tuple[Tensor, ...]`.
83-
return _format_output(is_inputs_tuple, gradients)
81+
return cast(
82+
TensorOrTupleOfTensorsGeneric, _format_output(is_inputs_tuple, gradients)
83+
)
8484

85-
# pyre-fixme[24] Generic type `Callable` expects 2 type parameters.
86-
def attribute_future(self) -> Callable:
85+
def attribute_future(self) -> None:
8786
r"""
8887
This method is not implemented for ModifiedReluGradientAttribution.
8988
"""

0 commit comments

Comments
 (0)