Skip to content

Commit

Permalink
Add type error suppressions for upcoming upgrade (#1340)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #1340

Reviewed By: MaggieMoss

Differential Revision: D62387756
  • Loading branch information
Pyre Bot Jr. authored and facebook-github-bot committed Sep 9, 2024
1 parent d8ceaa8 commit 39d545c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/attr/test_llm_attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ def device(self) -> torch.device:
# pyre-fixme[13]: Attribute `device` is never initialized.
# pyre-fixme[13]: Attribute `use_cached_outputs` is never initialized.
class TestLLMAttr(BaseTest):
# pyre-fixme[13]: Attribute `device` is never initialized.
device: str
# pyre-fixme[13]: Attribute `use_cached_outputs` is never initialized.
use_cached_outputs: bool

# pyre-fixme[56]: Pyre was not able to infer the type of argument `comprehension
Expand Down Expand Up @@ -377,6 +379,7 @@ def test_futures_not_implemented(self) -> None:
)
# pyre-fixme[13]: Attribute `device` is never initialized.
class TestLLMGradAttr(BaseTest):
# pyre-fixme[13]: Attribute `device` is never initialized.
device: str

@parameterized.expand(
Expand Down
3 changes: 3 additions & 0 deletions tests/attr/test_llm_attr_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ def device(self) -> torch._C.device:
# pyre-fixme[13]: Attribute `use_cached_outputs` is declared in class `TestLlmAttrGpu`
# to have type `bool` but is never initialized.
class TestLlmAttrGpu(BaseTest):
# pyre-fixme[13]: Attribute `device` is never initialized.
device: str
# pyre-fixme[13]: Attribute `use_cached_outputs` is never initialized.
use_cached_outputs: bool

@parameterized.expand([(FeatureAblation,), (ShapleyValueSampling,)])
Expand Down Expand Up @@ -235,6 +237,7 @@ def test_llm_attr_without_token_gpu(
# pyre-fixme[13]: Attribute `device` is declared in class `TestLLMGradAttrGPU`
# to have type `str` but is never initialized.
class TestLLMGradAttrGPU(BaseTest):
# pyre-fixme[13]: Attribute `device` is never initialized.
device: str

def test_llm_attr(self) -> None:
Expand Down
1 change: 1 addition & 0 deletions tests/helpers/basic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def __init__(self) -> None:
# pyre-fixme[2]: Parameter must be annotated.
def forward(self, input1, input2):
input = input1 + input2
# pyre-fixme[6]: For 1st argument expected `Tensor` but got `int`.
return 1 - F.relu(1 - input)[:, 1]


Expand Down

0 comments on commit 39d545c

Please sign in to comment.