Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type error suppressions for upcoming upgrade #1340

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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