Skip to content

Commit 30830b7

Browse files
Vivek Miglanifacebook-github-bot
authored andcommitted
Fix guided gradcam pyre fixme issues (#1596)
Summary: Pull Request resolved: #1596 Fixing unresolved pyre fixme issues in corresponding file Reviewed By: styusuf Differential Revision: D76737517 fbshipit-source-id: 5778697490484282bad9968ca6bfb72d0d4d5fc1
1 parent f8c25a4 commit 30830b7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

captum/attr/_core/guided_grad_cam.py

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

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

77
import torch
88
from captum._utils.common import _format_output, _format_tensor_into_tuples, _is_tuple
@@ -223,6 +223,7 @@ def attribute(
223223
)
224224
output_attr.append(torch.empty(0))
225225

226-
# pyre-fixme[7]: Expected `TensorOrTupleOfTensorsGeneric` but got
227-
# `Tuple[Tensor, ...]`.
228-
return _format_output(is_inputs_tuple, tuple(output_attr))
226+
return cast(
227+
TensorOrTupleOfTensorsGeneric,
228+
_format_output(is_inputs_tuple, tuple(output_attr)),
229+
)

0 commit comments

Comments
 (0)